Kill used Hotspot accounts?
Posted: Sun Feb 01, 2009 12:28 am
Hi,
I would like to write a script which automatically kills all Hotspot accounts that were used (uptime != 0) since the script was last called. Unfortunately, I seem to still have some issues understanding the scripting language.
Here is what I have today:
I guess that my $a doesn't get assigned a value which can be used in the /ip hotspot user get command, but where does the "211WLANHot", which is a value from the "profile" column of my user list, come from?
Can anybody please enlighten me? Thanks in advanced.
Greetings
Marc
I would like to write a script which automatically kills all Hotspot accounts that were used (uptime != 0) since the script was last called. Unfortunately, I seem to still have some issues understanding the scripting language.
Here is what I have today:
Code: Select all
[admin@microtik] /ip hotspot user> /system script print
Flags: I - invalid
0 name="kill-used-wlan-accounts" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff
last-started=jan/20/2009 15:12:00 run-count=31 source=
:foreach a in=[/ip hotspot user find uptime!=0 ] do={
:put $a
:put [/ip hotspot get $a name]
}
[admin@microtik] /ip hotspot user> /system script run 0
*1
211AuthHot
*cb
*cc
*cd
*ce
*cf
*d0
*13a
[admin@microtik] /ip hotspot user>
Can anybody please enlighten me? Thanks in advanced.
Greetings
Marc