From 7be3ef83e625a89337dcc7274cba1809117089e4 Mon Sep 17 00:00:00 2001 From: michael1 <1790241+michael1@users.noreply.github.com> Date: Tue, 9 Jan 2018 23:58:52 +0100 Subject: [PATCH] added error handling for failed login --- alexa_remote_control.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/alexa_remote_control.sh b/alexa_remote_control.sh index 54b0bc5..9899601 100644 --- a/alexa_remote_control.sh +++ b/alexa_remote_control.sh @@ -623,11 +623,20 @@ check_status if [ $? -eq 0 ] ; then echo "cookie expired, logging in again ..." log_in + check_status + if [ $? -eq 0 ] ; then + echo "log in failed, aborting" + exit 1 + fi fi if [ ! -f ${DEVLIST} ] ; then echo "device list do not exist. downloading ..." get_devlist + if [ ! -f ${DEVLIST} ] ; then + echo "failed to download device list, aborting" + exit 1 + fi fi if [ -n "$COMMAND" -o -n "$QUEUE" ] ; then