{"id":1043,"date":"2023-08-27T12:17:36","date_gmt":"2023-08-27T10:17:36","guid":{"rendered":"https:\/\/marschner.goip.de\/?p=1043"},"modified":"2023-08-29T20:24:55","modified_gmt":"2023-08-29T18:24:55","slug":"dyndns-update-bash-script","status":"publish","type":"post","link":"https:\/\/marschner.goip.de\/index.php\/2023\/08\/27\/dyndns-update-bash-script\/","title":{"rendered":"DynDns Update Bash-Script"},"content":{"rendered":"\n<p>Kleines Script f\u00fcr das Automatische Updaten das DynDns-Anbieters GOIP.de<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-code has-tertiary-background-color has-background\" style=\"line-height:1\"><code>#!\/bin\/bash\r\n\r\n# crontab -e \r\n# Zeile hinzuf  gen\r\n# *\/1 * * * * \/root\/DynDns_update.sh\r\n# Update-Script\r\n\r\n#### Konfiguration ####\r\nUSER=\"\"\r\nPASS=\"\"\r\n# IPv4 und IPv6\r\nDYNV6_PROTO=\"DynDNS GoIp.de\"\r\n#### Konfiguration Ende ####\r\n\r\nCURL=curl\r\n\r\nupdate_ip () {\r\n        source \"resolved.txt\"\r\n        resolved=$resolved\r\n        #Lese aktuelle IP\r\n        actual=$(curl -fsS \"https:\/\/api.ipify.org\")\r\n\r\n\r\n        #echo $actual\r\n        #echo \"alte IP: $resolved\"\r\n\r\n        if &#91; \"$resolved\" != \"$actual\" ] ; then\r\n          #echo \"Neue IP4: $actual\"\r\n          echo \"resolved=$actual\" > resolved.txt\r\n          curl \"https:\/\/www.goip.de\/setip?username=$USER&amp;password=$PASS&amp;ip=$actual\"\r\r\n        else\r\n          echo \"Kein Update erforderlich\"\r\n        fi\r\n\r\n        echo\r\n        echo \"Aktuelle IP: $actual\"\r\n        echo \"    Alte IP: $resolved\"\n}\r\n\r\nif &#91; -z $(which ${CURL}) ] ; then\r\n  echo \"curl nicht gefunden\"\r\n  echo \"Bitte mit 'sudo apt install curl' installieren\"\r\nexit 1\r\nfi\r\n\r\n#DynDns-Updater starten\r\nupdate_ip<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Kleines Script f\u00fcr das Automatische Updaten das DynDns-Anbieters GOIP.de<\/p>\n","protected":false},"author":1,"featured_media":1047,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,25],"tags":[65],"class_list":["post-1043","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-server","tag-bash"],"_links":{"self":[{"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/posts\/1043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/comments?post=1043"}],"version-history":[{"count":8,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/posts\/1043\/revisions"}],"predecessor-version":[{"id":1062,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/posts\/1043\/revisions\/1062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/media\/1047"}],"wp:attachment":[{"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/media?parent=1043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/categories?post=1043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marschner.goip.de\/index.php\/wp-json\/wp\/v2\/tags?post=1043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}