Removed scriptHelp error code exit and removed error code 1

This commit is contained in:
Asif Bacchus 2018-09-19 15:57:06 -06:00
parent 3581fd3bb5
commit 74a514feb8
2 changed files with 9 additions and 5 deletions

View File

@ -0,0 +1,4 @@
[2018-09-19 15:51:58] -- [ERROR] Script exited with code 1 --
Missing or invalid parameters on script invocation.
[2018-09-19 15:52:19] -- [ERROR] Script exited with code 1 --
Missing or invalid parameters on script invocation.

View File

@ -18,8 +18,8 @@ stamp="[`date +%Y-%m-%d` `date +%H:%M:%S`]"
### scriptHelp -- display usage information for this script
function scriptHelp {
echo "In the future, I will be something helpful!"
# exit with error code IF passed
quit $1
# exit with code 98 -- there is no use logging this
exit 98
}
### quit -- exit the script after logging any errors, warnings, etc. and
@ -56,7 +56,7 @@ errorExplain=()
### Error codes
errorExplain[1]="Missing or invalid parameters on script invocation."
### Process script parameters
@ -64,7 +64,7 @@ errorExplain[1]="Missing or invalid parameters on script invocation."
# if no parameters provided, then show the help page and exit with error
if [ -z $1 ]; then
# show script help page
scriptHelp 1
scriptHelp
fi
# use GetOpts to process parameters
@ -76,7 +76,7 @@ while getopts ':l:' PARAMS; do
;;
?)
# unrecognized parameters trigger scriptHelp
scriptHelp 1
scriptHelp
;;
esac
done