Skip to content

Instantly share code, notes, and snippets.

@jmbarbier
Created January 26, 2013 00:09
Show Gist options
  • Save jmbarbier/4639046 to your computer and use it in GitHub Desktop.
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.
#!/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