Last active
June 24, 2016 09:07
-
-
Save soffchen/4ca6f81b6dce20f88ba3dcda4065ce9d to your computer and use it in GitHub Desktop.
Revisions
-
soffchen renamed this gist
Jun 24, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ :global currentIP; :local newIP [/ip address get [find interface="cnc"] address]; :local newIP [:pick $newIP 0 [:find $newIP "/"]]; @@ -8,5 +7,4 @@ /tool fetch mode=https url="https://www.duckdns.org/update?domains=xxx&token=xxx&ip=$newIP" dst-path=duckdns.txt; :local result [/file get duckdns.txt contents]; :log info "Duck DNS update result: $result"; } -
soffchen created this gist
Jun 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ ``` :global currentIP; :local newIP [/ip address get [find interface="cnc"] address]; :local newIP [:pick $newIP 0 [:find $newIP "/"]]; :if ($newIP != $currentIP) do={ :log info "IP address $currentIP changed to $newIP"; :set currentIP $newIP; /tool fetch mode=https url="https://www.duckdns.org/update?domains=xxx&token=xxx&ip=$newIP" dst-path=duckdns.txt; :local result [/file get duckdns.txt contents]; :log info "Duck DNS update result: $result"; } ```