Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created November 9, 2018 21:12
Show Gist options
  • Save rms1000watt/350a07c99bb09ad6e14191fe6de014b4 to your computer and use it in GitHub Desktop.
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
#!/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