diff --git a/force_v4_update.sh b/force_v4_update.sh index 4e9c7e2..1ccf4d4 100755 --- a/force_v4_update.sh +++ b/force_v4_update.sh @@ -2,10 +2,10 @@ DDNS_V4=$(dig companioncu.be A +short @ns.geekify.de) PUBLIC_V4=$(ip -f inet addr show ppp0 | awk '/inet / {print $2}') -if [ "$DDNS_V4" = "$PUBLIC_V4" ]; then - #echo "no update needed" - exit 0 -else +if [ "$DDNS_V4" != "$PUBLIC_V4" ] || [ "$1" == "-f" ]; then bash "$(dirname $0)/multiupdater.sh" "THESE" "DONOT" "MATTER" "$PUBLIC_V4" +else + echo "no update needed" + exit 0 fi diff --git a/force_v6_update.sh b/force_v6_update.sh new file mode 100755 index 0000000..142a31d --- /dev/null +++ b/force_v6_update.sh @@ -0,0 +1,13 @@ +#!/bin/bash +DDNS_V6=$(dig companioncu.be AAAA +short @ns.geekify.de) +PUBLIC_V6=$(ip -f inet6 addr show ppp0 | grep "scope global" | grep -v "temporary" | awk '/inet6/ {print $2}' | cut -d"/" -f 1) + +if [ "$DDNS_V6" != "$PUBLIC_V6" ] || [ "$1" == "-f" ]; then + export reason=ROUTERADVERT + export nd1_addr1=$PUBLIC_V6 + bash "$(dirname $0)/multiupdater.sh" +else + #echo "no update needed" + exit 0 +fi +