This commit is contained in:
Alexander Schäferdiek 2020-03-21 21:14:27 +01:00
parent 580da795bf
commit 778f8d4ab6

View file

@ -96,7 +96,7 @@ echo "Checking ${hostname}"
if [ "${DYNV6_IPV6_ENABLED}" = "true" ]; then
echo "Testing IPv6";
ipv6Address=$(curl -s "https://v6.ident.me/")
ipv6Res=$(curl -fsS "http://ipv6.dynv6.com/api/update?hostname=${hostname}&ipv6=${ipv6Address}&token=${token}")
ipv6Res=$(curl -fsS "https://ipv6.dynv6.com/api/update?hostname=${hostname}&ipv6=${ipv6Address}&token=${token}")
ipv6Changed=true;
if [ "${ipv6Res}" = "addresses unchanged" ]; then
@ -116,7 +116,7 @@ fi
if [ "${DYNV6_IPV4_ENABLED}" = "true" ]; then
echo "Testing IPv4";
ipv4Address=$(curl -s "https://v4.ident.me/")
ipv4Res=$(curl -fsS "http://ipv4.dynv6.com/api/update?hostname=${hostname}&ipv4=${ipv4Address}&token=${token}")
ipv4Res=$(curl -fsS "https://ipv4.dynv6.com/api/update?hostname=${hostname}&ipv4=${ipv4Address}&token=${token}")
ipv4Changed=true;
if [ "$ipv4Res" = "addresses unchanged" ]; then
ipv4Changed=false;
@ -129,4 +129,4 @@ if [ "${DYNV6_IPV4_ENABLED}" = "true" ]; then
echo -e "IPv4 for ${hostname} on host ${HOSTMACHINE} changed to ${ipv4Address}" | mailx -s "[dynv6 IPv4 ${HOSTMACHINE}] IPv4 changed for ${hostname}" "${DYNV6_MAIL_ADDRESS}"
fi
fi
fi
fi