Community discussions

MikroTik App
 
biomann
just joined
Topic Author
Posts: 8
Joined: Thu Apr 25, 2013 11:12 am

After upgrade global variable is not populated

Wed Oct 30, 2019 1:49 pm

Good Day,

i just upgraded my RB2011 from RouterOS 6.43.12 to 6.45.7 and one of my scripts stopped working. Script looks like this:
{
:global S03IP

:local DestIP [:resolve s03.domain.com]

if ($DestIP != $S03IP) do={
  :log warn "Destination IP for IPSec-Tunnel S03 changed to $DestIP, fixing IPSec"
  
  /ip ipsec policy 
  set [find comment~"S03"] sa-dst-address=$DestIP;
   
  /ip ipsec peer
  set  [find comment="S03"] address=$DestIP;

  :set S03IP $DestIP
}
}
The last part (:set S03IP $DestIP) does not populate the global variable with the content of the local variable. Everything else in this script still works as intended (it also shows the correct IP in the log command, so the IP is stored in the local variable). I tried making DestIP a global variable as well, but it would still not work. Any ideas?

Greetings,
Markus

Who is online

Users browsing this forum: ariux, holvoetn, Jonty and 22 guests