Created
January 26, 2013 00:09
-
-
Save jmbarbier/4639046 to your computer and use it in GitHub Desktop.
Quand mon modem ADSL chauffait et plantait, reload automatique du réseau. Novembre 2005.
This file contains 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/sh | |
LSPING=`ping -c 3 www.free.fr 2>&1` | |
PINGRES=`echo $LSPING | egrep "100% packet loss|unknown"` | |
if [ "$PINGRES" != "" ]; then | |
echo "--- START NET RELOAD " >> /var/log/netreload | |
poff dsl-provider | |
sleep 45 | |
/sbin/mii-tool -F 10baseT-HD eth1 | |
pon dsl-provider | |
echo "Reason : " >> /var/log/netreload | |
date -u >> /var/log/netreload | |
echo $LSPING >> /var/log/netreload | |
echo "--- END NET RELOAD" >> /var/log/netreload | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment