Эта часть работает нормально { :local date [ /system clock get date ] :if ( [ /ip hotspot user get $user comment ] = “” ) do={ [ /ip hotspot user set $user comment=$date ] } }
Проблемная часть начинается здесь { :local offset 7 :global today { :local date [ /system clock get date ] :local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” ) :local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ) :local days [ :pick $date 4 6 ] :local monthtxt [ :pick $date 0 3 ] :local year [ :pick $date 7 11 ] :local months ([ :find $montharray $monthtxt] ) :for nodays from=0 to=$months do={ :set days ( $days + [ :pick $monthdays $nodays ] ) } :set days ($days + $year * 365) :set today $days }
:foreach i in [ /ip hotspot user find where disabled=no ] do={ :if ([ :find [ /ip hotspot user get $i comment ] ] = 0 ) do={ :local date [ /ip hotspot user get $i comment ] :local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” ) :local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ) :local days [ :pick $date 4 6 ] :local monthtxt [ :pick $date 0 3 ] :local year [ :pick $date 7 11 ] :local months ( [ :find $montharray $monthtxt ] ) :for nodays from=0 to=$months do={ :set days ( $days + [ :pick $monthdays $nodays ] ) } :set days ($days + $year * 365) :if ( ($days + $offset) < $today ) do={ :local name [/ip hotspot user get $i name] :log info “HOTSPOT EXPIRE SCRIPT: Отключаем Hotspot пользователя $name, первый вход $date” [ /ip hotspot user disable $i ] [ /ip hotspot active remove [find where user=$user] ] } } } }
Новое сообщение об ошибке в терминале: invalid value of “to”, must be integer
NORMIS, ПОЖАЛУЙСТА, ПОМОГИТЕ СДЕЛАТЬ СКРИПТ, ЧТОБЫ ОН СНОВА РАБОТАЛ КАК НАДО!!!
Проблемная часть начинается здесь { :local offset 7 :global today { :local date [ /system clock get date ] :local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” ) :local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ) :local days [ :pick $date 4 6 ] :local monthtxt [ :pick $date 0 3 ] :local year [ :pick $date 7 11 ] :local months ([ :find $montharray $monthtxt] ) :for nodays from=0 to=$months do={ :set days ( $days + [ :pick $monthdays $nodays ] ) } :set days ($days + $year * 365) :set today $days }
:foreach i in [ /ip hotspot user find where disabled=no ] do={ :if ([ :find [ /ip hotspot user get $i comment ] ] = 0 ) do={ :local date [ /ip hotspot user get $i comment ] :local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” ) :local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ) :local days [ :pick $date 4 6 ] :local monthtxt [ :pick $date 0 3 ] :local year [ :pick $date 7 11 ] :local months ( [ :find $montharray $monthtxt ] ) :for nodays from=0 to=$months do={ :set days ( $days + [ :pick $monthdays $nodays ] ) } :set days ($days + $year * 365) :if ( ($days + $offset) < $today ) do={ :local name [/ip hotspot user get $i name] :log info “HOTSPOT EXPIRE SCRIPT: Отключаем Hotspot пользователя $name, первый вход $date” [ /ip hotspot user disable $i ] [ /ip hotspot active remove [find where user=$user] ] } } } }
Новое сообщение об ошибке в терминале: invalid value of “to”, must be integer
NORMIS, ПОЖАЛУЙСТА, ПОМОГИТЕ СДЕЛАТЬ СКРИПТ, ЧТОБЫ ОН СНОВА РАБОТАЛ КАК НАДО!!!
