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