update hotspot users
Posted: Fri Jan 14, 2011 1:07 am
I am trying to write a script to update my users profile in hotspot/users
the problem I have with this script is that is always returns false and does the 'else' command
If I use this command.
I get the user printed.. so I know the user exists.. so when do my script always come back false?
to make it a bit more complicated I am also trying to find by the comment.
currently the script run from the command line this does not work
yet, both
and
work and come back with the same user, so why doesnt it work when I search for both?
thanks!
~Ken
Code: Select all
{:if ([/ip hotspot user find name="00:0C:42:69:40:2A" ] = True)
do={:put [set [/ip hotspot user find name="00:0C:42:69:40:2A"] profile="Premium" comment="Monteith,Stan"]}
else={:put [/ip hotspot user add name="00:0C:42:69:40:2A" profile="Premium"]}}
Code: Select all
[admin@Boathouse_Longshot] /ip hotspot user> {:if ([/ip hotspot user find name="00:0C:42:69:40:2A" ] = True) do={:put [set [/ip hotspot user find
name="00:0C:42:69:40:2A"] profile="Premium" comment="Monteith,Stan"]} else={:put [/ip hotspot user add name="00:0C:42:69:40:2A" profile="Premium"
]}}
failure: already have user with this name for this server
Code: Select all
/ip hotspot user print where name="00:0C:42:69:40:2A"
to make it a bit more complicated I am also trying to find by the comment.
currently the script run from the command line this does not work
Code: Select all
/ip hotspot user print where name="00:0C:42:69:40:2A" AND comment="Monteith,Stan"
Code: Select all
[admin@Boathouse_Longshot] /ip hotspot user> /ip hotspot user print where name="00:0C:42:69:40:2A" AND comment="Monteith,Stan"
Flags: X - disabled, D - dynamic
# SERVER NAME ADDRESS PROFILE UPTIME
Code: Select all
/ip hotspot user print where name="00:0C:42:69:40:2A"
Code: Select all
[admin@Boathouse_Longshot] /ip hotspot user> /ip hotspot user print where name="00:0C:42:69:40:2A"
Flags: X - disabled, D - dynamic
# SERVER NAME ADDRESS PROFILE UPTIME
0 ;;; Monteith,Stan
00:0C:42:69:40:2A Premium 0s
Code: Select all
/ip hotspot user print where comment="Monteith,Stan"
Code: Select all
[admin@Boathouse_Longshot] /ip hotspot user> /ip hotspot user print where comment="Monteith,Stan"
Flags: X - disabled, D - dynamic
# SERVER NAME ADDRESS PROFILE UPTIME
0 ;;; Monteith,Stan
00:0C:42:69:40:2A Premium 0s
thanks!
~Ken