diff --git a/bin/check_last_login.sh b/bin/check_last_login.sh index 6b3fcfc..c990ace 100755 --- a/bin/check_last_login.sh +++ b/bin/check_last_login.sh @@ -27,13 +27,14 @@ LOG="${BASE_FOLDER}/../log"; # auth log file user;date from collect_login_data script AUTH_LOG="${BASE_FOLDER}/../auth-log/user_auth.log"; +error=0; if [ $(whoami) != "root" ]; then echo "Script must be run as root user"; - exit; + error=1; fi; if [ ! -d "${LOG}" ]; then echo "log folder ${LOG} not found"; - exit; + error=1; fi; if [ -z $(command -v curl) ]; then echo "Missing curl application, aborting"; @@ -43,6 +44,9 @@ if [ -z $(command -v jq) ]; then echo "Missing jq application, aborting"; error=1; fi; +if [ $error -eq 1 ]; then + exit; +fi; # option 1 in list case "${1,,}" in text)