Guys
I just managed a basic script to reconfigure various parameters on a cpe, changing IP, disabling bridge, changing radio mode, enabling dhcp-server,adding NAT etc etc etc.
Now I want to go one step further and execute this script when the cpe is registered to a specific SSID.
Another words, the existing script is enabled but idle, but when I change SSID of my Ap’s, each cpe that then logs on will execute its script and reconfigure itself.
I’m not expecting any spoon feeding but just a suggestion, the script that I have is for example “script1”
and the existing AP SSID is “AAAA” and the new AP SSID will be “BBBB” for example.
thanks in advance.
SImon
Something like this may work:
:if ([/interface wireless get <interface> ssid] = "AAAA" do={
# Do action if SSID is AAAA
}
:if ([/interface wireless get <interface> ssid] = "BBBB" do={
# Do action if SSID is BBBB
}
...
To detect changes in ssid:
:global PrevSSID
:local ssid
:set ssid [/interface wireless get <interface> ssid]
:if ([:len $PrevSSID] = 0) do={ :set PrevSSID $ssid }
:if ($ssid != $PrevSSID) do={
:set PrevSSID $ssid
# SSID changed...
:if ($ssid = "AAAA" do={
}
:if ($ssid = "BBBB" do={
}
}
thanks but I managed to figure it out. With:
if ([int wir reg get 0 radio-name] != “test2”) do= {:execute script1}
Whereby “test2” is say the current config of the parent AP’s radio-name, then if it is changed to some other name, scrip1 is executed.
regards
Simon