Last active
August 29, 2015 14:06
-
-
Save GregGallant/4ab3126c4774df3e6db9 to your computer and use it in GitHub Desktop.
Be Bash Awesome... every shell script should have something similar
This file contains 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
pparam=$@; | |
if [ -z "$pparam" ]; then | |
echo "Usage: beAwesome.sh --[prod,stage]"; exit 1; | |
fi | |
for opt in $@; do | |
case $opt in | |
"--prod") | |
echo "Production run"; | |
DATABASE=seriousAwesome; | |
#... | |
;; | |
"--stage") | |
echo "Staging run"; | |
DATABASE=almostAwesome; | |
#... | |
;; | |
*) | |
echo "Invalid parameter: $opt"; | |
echo "Usage: beAwesome.sh --[prod,stage] \n\n"; | |
exit 1; | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment