Exit with error code on parameter errors
This commit is contained in:
parent
458a7d16e4
commit
dadb83cff8
0
backup.log
Normal file
0
backup.log
Normal 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
|
||||||
|
Loading…
Reference in New Issue
Block a user