Connexion / reconnexion ADSL
Voici un script qui teste la connexion ADSL et qui se reconnecte automatiquement.Il suffit de créer un fichier : reconnect.sh
#!/bin/sh
# script reconnect.sh
if ! ping -c 1 www.yahoo.com > /dev/null 2>&1
then
/usr/bin/killall pppd pppoe
sleep 10
pon dsl-provider
fi
# script reconnect.sh
if ! ping -c 1 www.yahoo.com > /dev/null 2>&1
then
/usr/bin/killall pppd pppoe
sleep 10
pon dsl-provider
fi
Et mettre dans crontab :
*/3 * * * * root /bin/reconnect.sh
Ne pas oublier de rendre le fichier reconnect.sh exécutable.
chmod ugo+x reconnect.sh
Accueil