Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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