Show scriptHelp if no parameters given. Redirect unknown parameters.
This commit is contained in:
parent
8be32fc01d
commit
71f7644175
@ -56,11 +56,11 @@ logFile="$scriptPath/${scriptName%.*}.log"
|
|||||||
# 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 1
|
scriptHelp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# use GetOpts to process parameters
|
# use GetOpts to process parameters
|
||||||
while getopts 'l:' PARAMS; do
|
while getopts ':l:' PARAMS; do
|
||||||
case "$PARAMS" in
|
case "$PARAMS" in
|
||||||
l)
|
l)
|
||||||
# use provided location for logFile
|
# use provided location for logFile
|
||||||
|
Loading…
Reference in New Issue
Block a user