Community discussions

MikroTik App
 
anassar26
just joined
Topic Author
Posts: 21
Joined: Sun Aug 02, 2020 3:20 pm

Plaese help! to modify script to work with dhcp leases ip only but I don't need to work with ppp or hotspot

Sun Aug 02, 2020 3:38 pm

I need help to modify script below to work with dhcp leases ip .
Script :
[{
:global time [/system clock get date]
:global day [ :pick $time 4 6 ]
/ppp secret;
:foreach m in=[find]\
do={\
:global days value=[:tostr [/ppp secret get $m comment]];
:global max value=[:pick $days -1 [:find $days "day"]];
:if ($max = $day) do={/ppp secret set $m profile=cut}
/ip hotspot ip;
:foreach b in=[find]\
do={\
:global r value=[:tostr [/ip hot ip get $b comment]];
:global ma value=[:pick $r -1 [:find $r "day"]];
:global address [get $b address]
:if ($ma = $day) do={/ip firewall add add list=cut address=$address comment=$r}
}}}]

Who is online

Users browsing this forum: rextended and 10 guests