Hello, can help me to make the script that can print or get WAN IP without it mask?
I’ve followed https://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Strip_netmask but still print the netmask.
Below is the script I use:
:global ipadd;
:local thisip [/ip address get [find where interface=ether1] address];
:put [:pick $thisip 0 [:find $thisip "/"]];
:if ($ipadd != $thisip) do={
/tool e-mail send to="email@domain.com" subject="Home IP change" body="Your new ip is $thisip
Wireless@XXXXX voucher: ftp://user:password@$thisip/voc/main.html";
set ipadd $thisip;
}
Took me hours to look for the solution.
Thanks in advance