It sounds like the wireless is your internet connection, and if one goes down, you want to change to a different connection.
Assuming I understand you correctly, this bit of untested code should get you going:
:if ([/ping altavista.com count=1] = 0) do={
:log Internet down, switching providers
:local CurrentSSID [/int wireless get [find interface=“wlan1”] ssid];
:if ($CurrentSSID=“isp1-ssid”) do={
/interface wireless set [/int wi find name=wlan1] ssid=isp2-ssid
} else {
/interface wireless set [/int wi find name=wlan1] ssid=isp1-ssid
}
} else {
:log Internet up… nothing to do
}If you need to change security profiles, you can do this at the same time you change the ssid.
About this, other question, is it possible to do this code using connection lists? Or how can I set a security profile?
Dummy question the code above isp1-ssid is the name of ssid I gonna switch?
Mikrotik Masters, I’ve made some changes to the first version of this script, but I have problems running it.
Could you look around to figure what the problem is?
Script for verify internet status and do modifications in case of internet fail
Creating local variables
:local currentStat 1;
:log info (“Verifying if internet is up”);