Created
July 28, 2015 20:01
-
-
Save omar-yassin/7ad1152f238e521449da to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# prints stdout and logs to file | |
function logger () | |
{ | |
echo "${1}" | tee -a $LOG_FILE | |
} | |
# function to wrap errors and exit | |
# USAGE: rc=${PIPESTATUS[0]} ; check_return_value | |
rc=0 | |
function check_return_value | |
{ | |
if [ $rc -eq 0 ] ; then | |
logger " ..... [INFO] Success! Return Value: $rc" | |
else | |
logger " ..... [ERROR] Operation FAILED!!! Please check the logs!" | |
exit 55 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment