This commit is contained in:
Mariusz B. / mgeeky 2023-03-07 14:14:37 +01:00
parent b95f9aadbf
commit dbcb0f85b5
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,12 @@ else
out=$(aws --profile $PROFILE_NAME sts assume-role --serial-number $SERIAL_MFA --role-arn $ROLE_ARN --role-session-name $ROLE_NAME --duration-seconds $DURATION --token-code $code 2>&1)
fi
if echo "$out" | grep -q -i 'error occurred' ; then
echo -e "[!] Assume role failed:\n"
echo "$out"
exit 1
fi
rolename=$PROFILE_NAME-$SESSION_NAME
if [[ "$OUTPUT_ROLE_NAME" != "" ]]; then