Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Commit ba76613

Browse files
committed
if iam returns no users at all, it is likey down (implementation merged from https://github.com/packetfairy/aws-ec2-ssh/blob/condoms/import_users.sh#L285) fixes #96
1 parent 88f5b58 commit ba76613

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

import_users.sh

+10
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,17 @@ function sync_accounts() {
250250
get_sudoers_groups_from_tag
251251

252252
iam_users=$(get_clean_iam_users | sort | uniq)
253+
if [ -z "${iam_users}" ]; then
254+
logger 'we just got back an empty iam_users user list -- that sounds wrong; bailing out!'
255+
exit 1
256+
fi
257+
253258
sudo_users=$(get_clean_sudoers_users | sort | uniq)
259+
if [ -z "${sudo_users}" ]; then
260+
logger 'we just got back an empty sudo_users user list -- that sounds wrong; bailing out!'
261+
exit 1
262+
fi
263+
254264
local_users=$(get_local_users | sort | uniq)
255265

256266
intersection=$(echo ${local_users} ${iam_users} | tr " " "\n" | sort | uniq -D | uniq)

0 commit comments

Comments
 (0)