Check that MAX_JOBS is positive integer or empty using grep.
This commit is contained in:
parent
1df57c8154
commit
01c36fc699
1 changed files with 3 additions and 1 deletions
4
ccollect
4
ccollect
|
@ -274,11 +274,13 @@ done
|
||||||
|
|
||||||
# check that MAX_JOBS is natural number > 0
|
# check that MAX_JOBS is natural number > 0
|
||||||
# empty string means run all in parallel
|
# empty string means run all in parallel
|
||||||
echo "${MAX_JOBS}" | awk '/^$/ { exit 0 } /^[1-9][0-9]*$/ { exit 0 } { exit 1 }'
|
echo "${MAX_JOBS}" | grep -q -E '^[1-9][0-9]*$|^$'
|
||||||
if [ "$?" -ne 0 ]
|
if [ "$?" -ne 0 ]
|
||||||
then
|
then
|
||||||
_exit_err "Invalid max jobs value \"${MAX_JOBS}\""
|
_exit_err "Invalid max jobs value \"${MAX_JOBS}\""
|
||||||
fi
|
fi
|
||||||
|
printf "REMOVE ME\n"
|
||||||
|
exit 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup interval
|
# Setup interval
|
||||||
|
|
Loading…
Reference in a new issue