#!/bin/bash# Loginuser='myuser'pass='mypass'MainHost='myhost.feste-ip.net'# Host to check (SubHost or MainHost)CheckHost="mysub.myhost.feste-ip.net"# InterfacesLanIf='re0'WanIf='re1'updateurl='v6.members.feste-ip.net'# VarsLanPref=$(ifconfig $LanIf | grep inet6 | grep -v fe80 | awk -v FS=" " '{ print $2 }' | awk -v FS=":" '{ print $1":"$2":"$3":"$4 }')WanIP=$(ifconfig $WanIf | grep inet6 | grep -v fe80 | awk -v FS=" " '{ print $2 }')# Curl-URLCurlURL="http://"$user":"$pass"@"$updateurl"/nic/update?hostname=$MainHost&myip="$WanIP"&subhostprefix="$LanPref# Check if SubHost is reachable, otherwise update dynDNSif ! ping6 -c 1 $CheckHost > /dev/null 2>&1 ; then curl $CurlURLfi;exit
[start]command:/usr/local/etc/rc.syshook.d/start/94-festedyndescription:FesteIP Updateparameters:type:script_outputmessage:updating Feste-IP.net