icinga-plugins/checks/check_dyndns_ip.sh

24 lines
427 B
Bash
Raw Normal View History

2019-12-02 22:51:02 +01:00
#!/bin/bash
dyndns_name="da-checka.ddnss.de"
myip="$(curl -s http://whatismyip.akamai.com/)"
dnsip="$(dig $dyndns_name +short)"
#debug
#echo -e "My IP:\t$myip\nDNS IP:\t$dnsip"
if [ "$myip" = "$dnsip" ]
then
echo "OK - My IP = \"$myip\"; DNS IP = \"$dnsip\""
exit 0
elif [ "$myip" != "$dnsip" ]
then
echo "CRITICAL - My IP = \"$myip\"; DNS IP = \"$dnsip\""
exit 2
else
echo "UNKNOWN - Unbekannter Status"
exit 3
fi