Skip to content

Instantly share code, notes, and snippets.

@aleron75
Created August 12, 2016 12:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleron75/5b35f8b670ad24bffbca48c0370135ec to your computer and use it in GitHub Desktop.
Save aleron75/5b35f8b670ad24bffbca48c0370135ec to your computer and use it in GitHub Desktop.
Bash script to get different exit codes upon the bin/magento setup:db:status command
#!/bin/bash
# use --no-ansi to avoid color characters
message=$(bin/magento setup:db:status --no-ansi)
if [[ ${message:0:3} == "All" ]];
then
exit 0 # 0 not required being default exit code; used for clarity
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment