Depois de quebrar a cabeça encontrei um solução paliativa no seguinte link:
http://forum.mikrotik.com/viewtopic.php?t=72394
Se este link não estiver mais funcionando segue uma pequena transcrição da solução:
Update :
on above scripts
:if ([/ip hotspot get 0 name] != [/system license get software-id]) do={/ip hotspot set 0 name=[/system license get software-id]We try to set on our mikrotik but scritps work but hotspot name update
we resolved by
for adding scripts need to check on box write, read
for adding scheduler need to check on box policy
full command
/system script add name="called1" policy=read,write source= {:if ([/ip hotspot get 0 name] != [/system license get software-id]) do={/ip hotspot set 0 name=[/system license get software-id]; /log info "Hotspot Name updated";}} /system scheduler add name=called policy=policy on-event="called1" interval=30m-----
Eu adaptei para as minhas necessidades conforme abaixo:
/system script add name="called1" policy=read,write source= {:if ([/ip hotspot get 0 name] != [/system routerboard get serial-number]) do={/ip hotspot set 0 name=[/system routerboard get serial-number]; /log warning "Hotspot Name updated";}} /system scheduler add name=onboot policy=policy on-event="called1" \ start-time=startup Com isto tenho um parâmetro único para cada um dos meus hotspot cuja variável é: server-name - HotSpot server name (set in the /ip hotspot menu, as the name property) ----- Segunda versão:/system script add name="called1" policy=read,write source= { :local serie [/system routerboard get serial-number]; :foreach i in=[/ip hotspot find] do={ :put [/ip hotspot get $i name]; :put $i :local serietmp ($serie . $i); :if ([/ip hotspot get $i name] != $serietmp) do={ /ip hotspot set $i name=$serietmp; /log warning "Hotspot Name updated"; } } } /system scheduler add name=onboot policy=policy on-event="called1" \ start-time=startup
0 comentários:
Postar um comentário