Explorar o código

Merge pull request #1453 from Skamasle/patch-19

Fix Min and hour limit in cron validation
Anton Reutov %!s(int64=8) %!d(string=hai) anos
pai
achega
bc82fcaf71
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      func/main.sh

+ 5 - 1
func/main.sh

@@ -723,8 +723,12 @@ is_ip_status_format_valid() {
 
 # Cron validator
 is_cron_format_valid() {
-    limit=60
+    limit=59
     check_format=''
+    if [ "$2" = 'hour' ]; then
+        limit=23
+    fi
+    
     if [ "$2" = 'day' ]; then
         limit=31
     fi