diff --git a/bin/check_last_login.sh b/bin/check_last_login.sh index f380417..8e376df 100755 --- a/bin/check_last_login.sh +++ b/bin/check_last_login.sh @@ -155,7 +155,7 @@ for ssh_group in ${ssh_groups[@]}; do found=$(grep "${username};" "${AUTH_LOG}"); fi; # always pre work account dates if they exist, but output only if text - if [ ! -z "${user_create_date_string}" ]; then + if [ -z "${found}" ] && [ ! -z "${user_create_date_string}" ]; then user_create_date=$(echo "${user_create_date_string}" | date +"%s" -f -); # if all empty, we continue with only check if user has last login date # else get days since creation