Last active
March 16, 2017 01:53
-
-
Save bcomnes/709167e2254fbf290f8ef13c545d8fce to your computer and use it in GitHub Desktop.
IPv6 DDNS client
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 | |
# https://community.ubnt.com/t5/EdgeMAX/IPv6-DDNS-script/td-p/1082829 | |
run=/opt/vyatta/bin/vyatta-op-cmd-wrapper | |
domain=leaf.bret.io | |
key=DDNSAUTHKEY | |
updateurl="https://${domain}:${key}@ipv6.dyn.dns.he.net/nic/update?hostname=${domain}" | |
interface=eth1 | |
lastipv6=`cat /config/ipv6address` | |
outsideipv6=`$run show interfaces ethernet $interface brief | grep "[0-9abcdef]*:[0-9abcdef:]*/"|tr -d '[:space:]'|cut -d/ -f1` | |
if test `find "/config/ipv6address" -mmin +10080` || [ "$lastipv6" != "$outsideipv6" ] | |
then | |
echo "Over one week since update or Changed IPv6" | |
curl -k -6 "${updateurl}" | |
echo $outsideipv6 > /config/ipv6address | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment