diff options
author | Erich Eckner <git@eckner.net> | 2017-03-01 12:02:25 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-03-01 12:02:25 +0100 |
commit | c2e9a88d028424c37dfc8b9a92869b03672ba8c8 (patch) | |
tree | 9b81e61aad49b417f2ae8d2ef7a2872715104d54 /update-ddns.in | |
parent | d9fd3cd1cf3fb4162bc66604ec58af1a826dc2f5 (diff) | |
download | update-ddns-c2e9a88d028424c37dfc8b9a92869b03672ba8c8.tar.xz |
update-ddns kann jetzt auch alle devices fragen
Diffstat (limited to 'update-ddns.in')
-rw-r--r-- | update-ddns.in | 11 |
1 files changed, 10 insertions, 1 deletions
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 | \ |