check_dyndns_ip.sh erstellt
This commit is contained in:
parent
1bc7e243c0
commit
b437b5a160
23
checks/check_dyndns_ip.sh
Executable file
23
checks/check_dyndns_ip.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user