Hi All a little help with a Loop
I have the below to detect if the /ip cloud has updated correctly after i had a problem with it not updating when my public ip changed. As I am trying to learn scripting I thought id try and write a solution and came up with the below.
This works perfectly except id like to put the script into a loop where the if option is
log info "forcing ip update";\
/ip cloud force-update ;\
delay "10" ;\
:local working "updated" ;\
:local status [/ip cloud get status] ;\
log info "IP Update forced status is $status" ;\
if (status !=working) \
do={:log error "Update IP to DNS Name has failed status is $status entering loop to resolve issue"; \
:log error "Sleeping for 10 seconds"; \
delay "10"; \
:log warning "forcing update again"; \
/ip cloud force-update;} \
else={:log warning "ip has been updated successfully"}
I have tried using
while (status !=working) \
do={:log error "Update IP to DNS Name has failed status is $status entering loop to resolve issue"; \
:log error "Sleeping for 10 seconds"; \
delay "10"; \
:log warning "forcing update again"; \
/ip cloud force-update;} \
else={:log warning "ip has been updated successfully"}
but i dont seam to be able to make it loop can anyone help please