Created
November 9, 2018 21:12
-
-
Save rms1000watt/350a07c99bb09ad6e14191fe6de014b4 to your computer and use it in GitHub Desktop.
bash check command output for failures if it fails and returns exit code 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if ! cmdOut=$(ssm-diff -p /ns init 2>&1) || echo "$cmdOut" | grep -i failed; then | |
| echo "ERROR: Failed pulling from SSM" | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment