i want write a scripte that
if ip hostpot ip-binding type = regular and server =“x” or “y”
then change to ip hostpot ip-binding type = regular.
thanx.
i want write a scripte that
if ip hostpot ip-binding type = regular and server =“x” or “y”
then change to ip hostpot ip-binding type = regular.
thanx.
So you basically want to change the “server” property to a value of “all”?
:foreach user in=[/ip hotspot ip-binding find server=x] do={ /ip hotspot ip-binding set $user server=all }; :foreach user in=[/ip hotspot ip-binding find server=y] do={ /ip hotspot ip-binding set $user server=all }
:foreach user in=[/ip hotspot ip-binding find server=101] do={ /ip hotspot ip-binding set $user type=regular };
this script not work!
"
[nimda@***] > system script run ip-bindig [above script]
input does not match any value of server
"
You’d get that output if you don’t actually have a hotspot server called 101 by name.
Post the output of
/ip hotspot print
Flags: X - disabled, I - invalid, S - HTTPS
0 hs-101 - f... 101 101 101 none
1 hs-115 - ... 115 115 115 5m
2 hs-117 - ... 117 117 117 5m
3 hs-118 - ... 118 118 118 5m
4 hs-123 - s... 123 123 123 5m
5 hs-140 - ... 140 140 140 none
6 hs-180 - ... 180 180 180 none
7 hs-127 127 127 127 none
8 hs-170 - a... 170 170 170 10h
9 hs-122 - a... 122 122 122 none
10 hs-107 - l... 107 107 107 none
11 hs-141 - cc 141 141 141 none
12 hs-125 - s... 125 125 125 none
13 hs-160 - t... 160 160 160 none
14 hs-142 142 142 142 none
15 hs-112 - ... 112 12 112 5m
16 hs-113 - p... 113 113 113 none
i want change servertype [regular - bypass - block]
So did you try using the server name? Your output shows the server is ‘hs-101’ and not ‘101’ so you’d use
:foreach user in=[/ip hotspot ip-binding find server=hs-101] do={ /ip hotspot ip-binding set $user type=regular };
and not
:foreach user in=[/ip hotspot ip-binding find server=101] do={ /ip hotspot ip-binding set $user type=regular };
Did you try that? Did it work?
than you that ok.