Exit with error code on parameter errors

This commit is contained in:
Asif Bacchus 2018-09-19 15:48:53 -06:00
parent 458a7d16e4
commit dadb83cff8
2 changed files with 2 additions and 2 deletions

0
backup.log Normal file
View File

View File

@ -60,7 +60,7 @@ errorExplain=()
# if no parameters provided, then show the help page and exit with error # if no parameters provided, then show the help page and exit with error
if [ -z $1 ]; then if [ -z $1 ]; then
# show script help page # show script help page
scriptHelp scriptHelp 1
fi fi
# use GetOpts to process parameters # use GetOpts to process parameters
@ -72,7 +72,7 @@ while getopts ':l:' PARAMS; do
;; ;;
?) ?)
# unrecognized parameters trigger scriptHelp # unrecognized parameters trigger scriptHelp
scriptHelp scriptHelp 1
;; ;;
esac esac
done done