Basically,
In the hotspot profile on login script area,
if the $user is the special username then
add the binding for that user. You may not need to worry about having more then
one active user with that name since when the binding is created the active
user will go away.
*untested code written by hand with out a mikrotik - crash and burn etc*
:local date [ /system clock get date ];
if ($user = “VIP” ) do={
:local mac [/ip hotspot active get [find where user=$user] mac-address]
/ip hotspot ip-binding add type=bypassed mac-address=$mac address=0.0.0.0
comment=$date;
}
Justin
On Mon, Feb 24, 2014, at 10:53 AM, Eric Muehleisen wrote:
> The login script below works like a champ. However, it creates a binding
> for every "active" user instead of the single user logging in.
>
> *:foreach users in=[/ip hotspot active find] do={*
> *:local date [ /system clock get date ];*
> *:local ip [/ip hotspot active get $users address];*
> *:local mac [/ip hotspot active get $users mac-address];*
> *:local username [/ip hotspot active get $users user];*
> */ip hotspot ip-binding add type=bypassed mac-address=$mac address=0.0.0.0
> comment=$date;*
> *}*
>
> I simply want a user to login with a special login/password that will
> automatically get a binding. The script above creates a binding for
> everyone who is active, not just the single user.
>
> Any ideas?
>
> Thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mail.butchevans.com/pipermail/mikrotik/attachments/20140224/38172738/attachment.html>
> _______________________________________________
> Mikrotik mailing list
> [email protected]
> http://mail.butchevans.com/mailman/listinfo/mikrotik
>
> Visit http://blog.butchevans.com/ for tutorials related to Mikrotik RouterOS
--
Justin
_______________________________________________
Mikrotik mailing list
[email protected]
http://mail.butchevans.com/mailman/listinfo/mikrotik
Visit http://blog.butchevans.com/ for tutorials related to Mikrotik RouterOS