moved get_devlist after check_status

This commit is contained in:
Alex 2017-12-20 18:55:59 +01:00 committed by GitHub
parent 4036885185
commit aa34df6f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -16,6 +16,7 @@
# 2017-12-07: v0.7b added Bluetooth connect/disconnect # 2017-12-07: v0.7b added Bluetooth connect/disconnect
# 2017-12-18: v0.7c fixed US version # 2017-12-18: v0.7c fixed US version
# 2017-12-19: v0.7d fixed AWK csrf extraction on some systems # 2017-12-19: v0.7d fixed AWK csrf extraction on some systems
# 2017-12-20: v0.7e moved get_devlist after check_status
# #
### ###
# #
@ -618,17 +619,17 @@ if [ ! -f ${COOKIE} ] ; then
log_in log_in
fi fi
if [ ! -f ${DEVLIST} ] ; then
echo "device list do not exist. downloading ..."
get_devlist
fi
check_status check_status
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
echo "cookie expired, logging in again ..." echo "cookie expired, logging in again ..."
log_in log_in
fi fi
if [ ! -f ${DEVLIST} ] ; then
echo "device list do not exist. downloading ..."
get_devlist
fi
if [ -n "$COMMAND" -o -n "$QUEUE" ] ; then if [ -n "$COMMAND" -o -n "$QUEUE" ] ; then
if [ "${DEVICE}" = "ALL" ] ; then if [ "${DEVICE}" = "ALL" ] ; then
for DEVICE in $(jq -r '.devices[] | select( .deviceFamily == "ECHO" or .deviceFamily == "WHA") | .accountName' ${DEVLIST} | sed -r 's/ /%20/g') ; do for DEVICE in $(jq -r '.devices[] | select( .deviceFamily == "ECHO" or .deviceFamily == "WHA") | .accountName' ${DEVLIST} | sed -r 's/ /%20/g') ; do

View File

@ -3,7 +3,7 @@
# Amazon Alexa Remote Control (PLAIN shell) # Amazon Alexa Remote Control (PLAIN shell)
# alex(at)loetzimmer.de # alex(at)loetzimmer.de
# #
# 2017-12-19: v0.7d (for updates see http://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html) # 2017-12-20: v0.7de(for updates see http://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html)
# #
### ###
# #
@ -585,17 +585,17 @@ if [ ! -f ${COOKIE} ] ; then
log_in log_in
fi fi
if [ ! -f ${DEVTXT} ] ; then
echo "device list do not exist. downloading ..."
get_devlist
fi
check_status check_status
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
echo "cookie expired, logging in again ..." echo "cookie expired, logging in again ..."
log_in log_in
fi fi
if [ ! -f ${DEVTXT} ] ; then
echo "device list do not exist. downloading ..."
get_devlist
fi
if [ -n "$COMMAND" ] ; then if [ -n "$COMMAND" ] ; then
set_var set_var
if [ -n "$COMMAND" ] ; then if [ -n "$COMMAND" ] ; then