diff --git a/import_users.sh b/import_users.sh index 8efda08..c8ac168 100755 --- a/import_users.sh +++ b/import_users.sh @@ -250,7 +250,17 @@ function sync_accounts() { get_sudoers_groups_from_tag iam_users=$(get_clean_iam_users | sort | uniq) + if [ -z "${iam_users}" ]; then + logger 'we just got back an empty iam_users user list -- that sounds wrong; bailing out!' + exit 1 + fi + sudo_users=$(get_clean_sudoers_users | sort | uniq) + if [ -z "${sudo_users}" ]; then + logger 'we just got back an empty sudo_users user list -- that sounds wrong; bailing out!' + exit 1 + fi + local_users=$(get_local_users | sort | uniq) intersection=$(echo ${local_users} ${iam_users} | tr " " "\n" | sort | uniq -D | uniq)