Skip to content

Commit add956b

Browse files
authored
Merge pull request hestiacp#1452 from Skamasle/patch-18
Fix cron validation
2 parents 8a21735 + 5a108be commit add956b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

func/main.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,13 @@ is_cron_format_valid() {
753753
fi
754754
done
755755
fi
756-
if [[ "$1" =~ ^[0-9]+$ ]] && [ "$1" -le $limit ]; then
757-
check_format='ok'
758-
fi
756+
crn_values=$(echo $1 |tr "," " " | tr "-" " ")
757+
for crn_vl in $crn_values
758+
do
759+
if [[ "$crn_vl" =~ ^[0-9]+$ ]] && [ "$crn_vl" -le $limit ]; then
760+
check_format='ok'
761+
fi
762+
done
759763
if [ "$check_format" != 'ok' ]; then
760764
check_result $E_INVALID "invalid $2 format :: $1"
761765
fi

0 commit comments

Comments
 (0)