Script to delete user in "IP DHCP SERVER LEASES"
Posted: Sun Jun 30, 2024 11:12 pm
Greetings gentlemen, I have a script that eliminates the clients connected to the HOTSPOT and it works very well for me, but I would like that same script to also eliminate that user in IP DHCP SERVER LEASES, I need your help, thanks in advance. Here I leave the script.
Code: Select all
:local comment "IN USE"
:local userprofile [ip hotspot user get [find where name="$user"] profile]
:if ([/ip hotspot user get $user comment]="") do={[/ip hotspot user set $user comment=$comment]}
[/system scheduler
add comment= [/ip hotspot user profile get [find where name="$userprofile"] name] name=$user on-event="/ip hotspot user remove \"$user\" \r\
\n/system scheduler remove [find where name=\"$user\"] \r\
\n\r\
" interval= [/ip hotspot user profile get [find where name="$userprofile"] session-timeout]]