Last active
May 1, 2019 00:33
-
-
Save bcomnes/a2f338e164fc2b9ffc33 to your computer and use it in GitHub Desktop.
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 characters
# /etc/systemd/system/update-ddns.service | |
[Unit] | |
Description=Update DDNS | |
Documentation=https://dns.he.net/docs.html | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash /root/update-ddns.sh |
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 characters
#!/bin/bash | |
# /root/update-ddns.sh | |
# update dynamicDNS | |
# | |
# chmod 750 /root/update-ddns.sh | |
DDOMAIN=pi.bret.io | |
DPW=password | |
# ipv4 | |
/usr/bin/curl -k -4 "https://${DDOMAIN}:${DPW}@dyn.dns.he.net/nic/update?hostname=${DDOMAIN}" | |
# ipv6 | |
/usr/bin/curl -k -6 "https://${DDOMAIN}:${DPW}@dyn.dns.he.net/nic/update?hostname=${DDOMAIN}" |
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 characters
# /etc/systemd/system/update-ddns.timer | |
[Unit] | |
Description=Update DDNS every 24 hours | |
[Timer] | |
OnBootSec=1min | |
OnUnitActiveSec=1d | |
[Install] | |
WantedBy=timers.target | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment