Simple script works in terminal but not via RUN script

:global isIPcurrent;

:if ($isIPcurrent!=$currentIP) do={
:log info “YES”
:set $isIPcurrent $currentIP;
/user set sshuser address=($currentIP,/32,192.168.200.0/24) }So this works when pasted in terminal but not when I paste it in a new script and run it. I really don’t understand why? Any clues:-)?

write your script between { } , and remove comma in ($currentIP,/32,192.168.200.0/24) like this ($currentIP/32,192.168.200.0/24)

your script will be:

{
:global isIPcurrent;

:if ($isIPcurrent!=$currentIP) do={
:log info “YES”
:set $isIPcurrent $currentIP;
/user set sshuser address=($currentIP/32,192.168.200.0/24) }
}