Check that MAX_JOBS is positive integer or empty using grep.

This commit is contained in:
Darko Poljak 2016-08-08 15:56:19 +02:00
parent 1df57c8154
commit 01c36fc699
1 changed files with 3 additions and 1 deletions

View File

@ -274,11 +274,13 @@ done
# check that MAX_JOBS is natural number > 0
# 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 ]
then
_exit_err "Invalid max jobs value \"${MAX_JOBS}\""
fi
printf "REMOVE ME\n"
exit 0
#
# Setup interval