summaryrefslogtreecommitdiff
path: root/update-ddns.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-12-11 10:32:23 +0100
committerErich Eckner <git@eckner.net>2017-12-11 10:32:23 +0100
commitb1401c9a8c36b545ec076f77d250a690b814cf91 (patch)
tree4345e28644de83211fc29bd4c3d5e5f255753010 /update-ddns.in
parent9a6de85bb7552bc2489a839a5f975a4c35ce5d3e (diff)
downloadupdate-ddns-b1401c9a8c36b545ec076f77d250a690b814cf91.tar.xz
update-ddns.in: "ignore $ipRegEx" new
Diffstat (limited to 'update-ddns.in')
-rw-r--r--update-ddns.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/update-ddns.in b/update-ddns.in
index 0fe0495..ff589d8 100644
--- a/update-ddns.in
+++ b/update-ddns.in
@@ -20,6 +20,8 @@ then
done
fi
+unset ignoreIps
+
i=0
while read -r ipVer updateUrl dnsName
@@ -30,6 +32,12 @@ do
continue
fi
+ if [[ "${ipVer}" == 'ignore' ]]
+ then
+ ignoreIps="${ignoreIps} ${updateUrl} ${dnsName}"
+ continue
+ fi
+
if [[ "${ipVer}" == *"?" ]]
then
ipVer="${ipVer%?}"
@@ -71,6 +79,20 @@ do
done < #ETCDIR#/update-ddns.conf
+ignoreIps='^\('"$(
+ echo ${ignoreIps} | \
+ tr '[:space:]' '\n' | \
+ grep -vxF '' | \
+ sort -u | \
+ sed '
+ s@$@\\|@
+ ' | \
+ tr -d '\n' | \
+ sed '
+ s@\\|$@@
+ '
+)"'\)$'
+
for dnsName in $( \
echo "${dnsNamen[@]}" | \
tr ' ' '\n' | \
@@ -115,6 +137,7 @@ do
"${ipCmd}" -o ${ipCmdVers[${j}]} addr show scope global | \
awk '{print $4}' | \
cut -d/ -f1 | \
+ grep -vx "${ignoreIps}" | \
sort -u
)"