/system script
add name=DOWN-LINK-1 policy=ftp,read,write,winbox source=\
"/ip firewall nat enable [find comment=\"MANUTENCAO\"]\r\
\n"
add name=LINK-UP-1 policy=ftp,read,write,winbox source=\
"/ip firewall nat disable [find comment=\"MANUTENCAO\"]\r\
\n"
add name=REMOVER-DNS-DINAMICO-OFF policy=ftp,read,write,winbox source=\
"/ ip dns static remove [/ip dns static find dynamic=yes]\r\
\n"
add name=REMOVER-DNS-DINAMICO-ON-1 policy=ftp,read,write,winbox source=\
"/ip dns static remove [/ip dns static find dynamic=yes]\r\
\n"
add name=REMOVER-DNS-DINAMICO-ON-2 policy=ftp,read,write,winbox source=\
"/system script run LINK-UP\r\
\n"
add name=REMOVER-DNS-DINAMICO-ON-3 policy=ftp,read,write,winbox source="/syste\
m scheduler disable [/system scheduler find name=remover_dns_dinamico_on]\
\r\
\n"
add name=REMOVER-DNS-DINAMICO-ON-4 policy=ftp,read,write,winbox source="/syste\
m scheduler disable [/system scheduler find name=remover_dns_dinamico_off]\
"
add name=DOWN-LINK-2 policy=ftp,read,write,winbox source=\
"/ip hotspot profile set hsprof1 html-directory=manutencao\r\
\n"
add name=DOWN-LINK-3 policy=ftp,read,write,winbox source="/ip dns static set [\
/ip dns static find name=internet.wireless] address=192.168.2.222 comment=\
\"\" disabled=no name=.* ttl=5s"
add name=LINK-UP-3 policy=ftp,read,write,policy,test,winbox,sniff,sensitive \
source="\r\
\n/ip dns static set [/ip dns static find name=.*] address=192.168.2.222 c\
omment=\"\" disabled=no name=internet.wireless ttl=30s\r\
\n"
add name=LINK-UP-2 policy=ftp,read,write,winbox source=\
"\r\
\n/ip hotspot profile set hsprof1 html-directory=hotspot\r\
\n"
/tool netwatch
add comment="MONITORAR LINK" disabled=no down-script="/ system script run DOWN\
-LINK-1\r\
\n/ system script run DOWN-LINK-2\r\
\n/ system script run DOWN-LINK-3\r\
\n\r\
\n/ system scheduler enable [/system scheduler find name=remover_dns_dinam\
ico_off]\r\
\n" host=8.8.8.8 interval=5s timeout=1s up-script="/system scheduler enabl\
e [/system scheduler find name=remover_dns_dinamico_on]\r\
\n/ system script run LINK-UP-1\r\
\n/ system script run LINK-UP-2\r\
\n/ system script run LINK-UP-3\r\
\n/ queue simple remove hs-<hotspot1>"