blob: c28e1e665520447993ebffd9f0844fe4b96c508d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 --silent "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
|