Rename some roles to make ansible-lint happy.

This commit is contained in:
Andreas B. Mundt 2022-06-12 14:27:44 +02:00 committed by Andreas B. Mundt
parent 4d791a65f1
commit 1db0b6ec31
75 changed files with 29 additions and 29 deletions

View file

@ -0,0 +1,35 @@
#!/bin/bash
set -eu
. /etc/ddns-update/ddns-update.conf
DDHOST="https://www.ddnss.de/upd.php"
if ! DNSRESULT="$(host $DDNSNAME)" ; then
echo "Could not resolve IP address for '$DDNSNAME', no update."
exit 0
fi
DNSIP4="$(echo "$DNSRESULT" | grep -m 1 -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$' || true )"
DNSIP6="$(echo "$DNSRESULT" | grep -m 1 -oE '[0-9a-f]{1,4}:.+:[0-9a-f]{1,4}' || true )"
REALIP4="$(wget -q -O - https://ip4.ddnss.de/meineip.php | \
grep -m 1 -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' || true )"
REALIP6="$(wget -q -O - https://ip6.ddnss.de/meineip.php | \
grep -m 1 -oE '[0-9a-f]{1,4}:.+:[0-9a-f]{1,4}' || true )"
if [ -z "$REALIP4" -a -z "$REALIP6" ] ; then
echo "Could not detect real IP addresses, exiting."
exit 0
fi
echo "Current DNS: IPv4=$DNSIP4, IPv6=$DNSIP6."
echo "Detected: IPv4=$REALIP4, IPv6=$REALIP6."
if [ "$REALIP4" == "$DNSIP4" -a "$REALIP6" == "$DNSIP6" ] ; then
echo "IP address unchanged, no update."
else
echo "IP address changed: $DNSIP4 → ${REALIP4}, $DNSIP6 → ${REALIP6}, updating ddns."
wget -q -O - $DDHOST'?key='$KEYAUTH'&host='$DDNSNAME'&ip='$REALIP4'&ip6='$REALIP6 \
| grep -oE "Updated .+ hostname." || echo "Update not confirmed, it might have failed."
fi

View file

@ -0,0 +1,6 @@
[Unit]
Description=Update ddns
[Service]
Type=oneshot
ExecStart=/usr/local/bin/ddns-update

View file

@ -0,0 +1,11 @@
[Unit]
Description=Update ddns IP-address
[Timer]
OnBootSec=0
OnUnitActiveSec=20min
AccuracySec=3min
[Install]
WantedBy=timers.target