Merge pull request #1452 from Skamasle/patch-18

Fix cron validation
This commit is contained in:
Anton Reutov 2018-01-25 18:48:19 +03:00 committed by GitHub
commit add956bb62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -753,9 +753,13 @@ is_cron_format_valid() {
fi
done
fi
if [[ "$1" =~ ^[0-9]+$ ]] && [ "$1" -le $limit ]; then
check_format='ok'
fi
crn_values=$(echo $1 |tr "," " " | tr "-" " ")
for crn_vl in $crn_values
do
if [[ "$crn_vl" =~ ^[0-9]+$ ]] && [ "$crn_vl" -le $limit ]; then
check_format='ok'
fi
done
if [ "$check_format" != 'ok' ]; then
check_result $E_INVALID "invalid $2 format :: $1"
fi