Quantcast
Channel: All EdgeRouter posts
Viewing all articles
Browse latest Browse all 60861

Re: IPv6 DDNS script

$
0
0
#!/bin/bash
run=/opt/vyatta/bin/vyatta-op-cmd-wrapper

updater_client_key='your_updater_client_key_here'
user='username'
hosts='example.dyndns.org,another.dyndns.org'
updateurl="https://${user}:${updater_client_key}@members.dyndns.org/v3/update?hostname=${hosts}&myip="
interface='eth0'

last_ipv6_file='/config/ipv6address'
outsideipv6="$( ${run} show interfaces ethernet ${interface} brief | grep "[0-9abcdef]*:[0-9abcdef:]*/"|tr -d '[:space:]'|cut -d/ -f1 )"

if [[ -f ${last_ipv6_file} ]]; then
  lastipv6=$( cat /config/ipv6address )
fi

if [[ -z "${lastipv6}" ]] ||  [[ "${lastipv6}" != "${outsideipv6}" ]] || test $( find "/config/ipv6address" -mmin +10080 ); then
 echo "Over one week since update or Changed IPv6"
 curl "${updateurl}${outsideipv6}"
 echo ${outsideipv6} > /config/ipv6address
fi

I found your script when I wanted to do some ipv6 for my dyndns domain and adapted it a little for my own uses. Thanks! Maybe someone would appreciate these minor changes.


Viewing all articles
Browse latest Browse all 60861

Trending Articles