From c2e9a88d028424c37dfc8b9a92869b03672ba8c8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 1 Mar 2017 12:02:25 +0100 Subject: update-ddns kann jetzt auch alle devices fragen --- update-ddns.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/update-ddns.in b/update-ddns.in index 6626ed4..063350d 100644 --- a/update-ddns.in +++ b/update-ddns.in @@ -30,10 +30,12 @@ do then dnsVer="A" inetVer="inet" + ipCmdVer='-4' elif [ "${ipVer}" == "6" ] then dnsVer="AAAA" inetVer="inet6" + ipCmdVer='-6' else >&2 echo 'Error: First column in "#ETCDIR#/update-ddns.conf" needs to be "4" or "6"!' exit 1 @@ -55,8 +57,15 @@ do sort -u )" + if [ "${dev}" == "-" ] + then + unset dev + else + dev="dev ${dev}" + fi + ips="$( - "${ipCmd}" addr show dev "${dev}" | \ + "${ipCmd}" "${ipCmdVer}" addr show ${dev} scope global | \ grep "^\s*${inetVer}\s.*\sscope\sglobal\s" | \ awk '{print $2}' | \ cut -d/ -f1 | \ -- cgit v1.2.3-70-g09d2