From 6be62f1d79e3850d4a056b3eec9064e1123eba22 Mon Sep 17 00:00:00 2001 From: simono41 Date: Sun, 7 Jun 2020 00:05:16 +0200 Subject: [PATCH] fix --- ddupdater | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ddupdater b/ddupdater index 12b5d54..172803e 100755 --- a/ddupdater +++ b/ddupdater @@ -7,10 +7,12 @@ HOSTNAME="spectreos.ddnss.de" PFAD="/home/pi" ALLHOST="all" # Alternativ Hostname DATUM=`date +%Y-%m-%d\ %H:%M:%S` -IPV4=`curl https://ip4.code-planet.de/meineip.php | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'` -if [ -f "$PFAD/updipv4.txt" ]; then UPDIPV4=`cat $PFAD/updipv4.txt; fi -IPV6=`curl https://ip6.code-planet.de/meineip.php | grep -oE '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))'` -if [ -f "$PFAD/updipv6.txt" ]; then UPDIPV6=`cat $PFAD/updipv6.txt; fi + +IPV4=$(curl https://ip4.code-planet.de/meineip.php | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}') +IPV6=$(curl https://ip6.code-planet.de/meineip.php | grep -oE '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))') + +if [ -f "$PFAD/updipv4.txt" ]; then UPDIPV4=$(cat $PFAD/updipv4.txt); fi +if [ -f "$PFAD/updipv6.txt" ]; then UPDIPV6=$(cat $PFAD/updipv6.txt); fi echo "Aktuelle IPV4=$UPDIPV4" echo "Aktuelle IPV6=$UPDIPV6"