Last active
January 3, 2016 01:39
-
-
Save alloydwhitlock/8390969 to your computer and use it in GitHub Desktop.
Fail Detection
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
#!/bin/bash | |
# | |
#Name: Fail Detection | |
#Function: If the previously executed command fails the script will exit. | |
function failDetect () { | |
if [ $? -eq 0 ]; then | |
echo -e "Something went horribly wrong... exiting script." | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment