Created
October 6, 2016 04:42
-
-
Save samos123/261c9a87a5e933c1a23b6b75d6a560ae to your computer and use it in GitHub Desktop.
Small script to check connectivity through ping periodically on openwrt routers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
today=$(date +"%d-%m-%Y") | |
time=$(date -I'seconds') | |
echo "Pinging 8.8.8.8 at $time" >> /var/log/ping-check-$today | |
ping -c 5 8.8.8.8 | grep -E "round-trip|packet loss" >> /var/log/ping-check-$today | |
# Optionally create a cron job to execute every minute | |
# Contrab: */1 * * * * /root/ping-check.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment