You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
601 B

1 year ago
#!/bin/bash
if ping -c 1 o2.de &> /dev/null
then
1 year ago
echo "Sende E-Mail" &> /dev/null
1 year ago
#mail -s "Pingtest" system@hephaistos.schwalbert.net < ./ping.log
#rm ./ping.log
else
1 year ago
date +"%D %T" >> ./ping.log
1 year ago
if ping -c 1 192.168.1.1 &> /dev/null
then
1 year ago
echo "Internet nicht erreichbar: (Ping o2.de fehlgeschlagen, Ping Internetgateway erfolgreich)" >> ./ping.log
1 year ago
else
1 year ago
echo "Netzwerk nicht erreichbar: (Ping o2.de fehlgeschlagen, Ping Internetgateway fehlgeschlagen)" >> ./ping.log
1 year ago
fi
echo ""
fi