summarylogtreecommitdiffstats
path: root/duckdns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'duckdns.sh')
-rwxr-xr-xduckdns.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/duckdns.sh b/duckdns.sh
new file mode 100755
index 000000000000..2503a3a12199
--- /dev/null
+++ b/duckdns.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+logger -t DuckDNS "Updating DuckDNS entries"
+EXITCODE=0
+for file in /etc/duckdns.d/*.cfg
+do
+ source "${file}"
+ logger -t DuckDNS "Executing config file '${file}'"
+ OUTPUT=$(curl -k -s "https://www.duckdns.org/update?domains=${duckdns_hostname}&token=${duckdns_token}&ip=")
+ logger -t DuckDNS ${OUTPUT}
+ if [ "${OUTPUT}" == "KO" ]; then
+ logger -t DuckDNS "You should check if your domain/token is correct because the server responded negatively!"
+ $EXITCODE=1
+ fi
+done
+
+exit $EXITCODE \ No newline at end of file