Skip to content

Instantly share code, notes, and snippets.

@bcomnes
Last active May 1, 2019 00:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcomnes/a2f338e164fc2b9ffc33 to your computer and use it in GitHub Desktop.
Save bcomnes/a2f338e164fc2b9ffc33 to your computer and use it in GitHub Desktop.
# /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
#!/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}"
# /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