Make force scripts functional

This commit is contained in:
root 2024-09-26 18:01:32 +02:00
parent e2a24c04c6
commit d4b3545ef9
2 changed files with 17 additions and 4 deletions

View file

@ -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

13
force_v6_update.sh Executable file
View file

@ -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