4
This commit is contained in:
parent
c7213e3ae1
commit
829cd4144c
19
updateIpCloudIfNotUpToDate.txt
Normal file
19
updateIpCloudIfNotUpToDate.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
do {
|
||||||
|
#get current external IP
|
||||||
|
:local currentIP [:resolve myip.opendns.com server=resolver1.opendns.com];
|
||||||
|
:local resolvedIP;
|
||||||
|
|
||||||
|
# Determine if DNS update is needed
|
||||||
|
:if ($currentIP != $resolvedIP) do={
|
||||||
|
:log info "Mynetname update needed: Current-IP: $currentIP Resolved-IP: $resolvedIP";
|
||||||
|
/ip/cloud/force-update;
|
||||||
|
:local resolvedIP [:resolve myip.opendns.com server=resolver1.opendns.com];
|
||||||
|
} else={
|
||||||
|
:local resolvedIP [:resolve myip.opendns.com server=resolver1.opendns.com];
|
||||||
|
#:log info "Mynetname: No update needed $currentIP equals $resolvedIP";
|
||||||
|
}
|
||||||
|
} on-error={
|
||||||
|
:log info "Error force-update";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user