Added error handling for failed logins

Added error handling for failed logins
Moved the get_devlist after the re-login section
This commit is contained in:
michael1 2018-01-09 23:38:19 +01:00 committed by GitHub
parent 20d94b6b1a
commit 4b4c467eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -612,19 +612,28 @@ if [ -z "$BLUETOOTH" -a -z "$LEMUR" -a -z "$PLIST" -a -z "$HIST" -a -z "$SEEDID"
fi fi
if [ ! -f ${COOKIE} ] ; then if [ ! -f ${COOKIE} ] ; then
echo "cookie do not exist. logging in ..." echo "cookie does not exist. logging in ..."
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
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 fi
if [ -n "$COMMAND" -o -n "$QUEUE" ] ; then if [ -n "$COMMAND" -o -n "$QUEUE" ] ; then