Reconnexion ADSL
Bonsoir !
J'ai un petit problème lors de la reconnexion
En effet il arrive que dé fois je ne suis plus connecté
mais j'ai toujours un connexion qui y réside.
Résultat je ne peu plus surfer mais lors d'un ifconfig
J'ai toujours ppp0 avec un adresse IP !
Alors si quelqu'un a une solution... Je suis preneur !
Au fait je suis sur un Modem Alcatel USB
Voici les sources :
Dans /etc/adsl/
------------------------------------------------------------------------
--------
# adsl.conf
ADSL=/etc/init.d
CHECKIP=/etc/adsl
DDNS=/usr/sbin
DELAY=20
SBIN=/sbin
IPDELAY=120
DDNSDELAY=10
LOG=/var/log/adsl
PPPD=/usr/sbin
Dans /etc/adsl/
------------------------------------------------------------------------
--------
#!/bin/sh
# checkip.sh
. /etc/adsl/adsl.conf
getip() {
IP=`$SBIN/ifconfig ppp0 | fgrep "inet ad" | cut -f2 -d":"
| cut -f1 -d" "`
}
echo "Démarrage de checkip : " >> $LOG
while true; do
sleep $IPDELAY
getip
if ! [ "$IP" ]; then
echo "Redémarrage ADSL: " >> $LOG
$ADSL/adsl restart &
fi
done
Dans /etc/init.d/
------------------------------------------------------------------------
--------
#!/bin/sh
# adsl.sh
. /etc/adsl/adsl.conf
getip() {
IP=`$SBIN/ifconfig ppp0 | fgrep "inet ad" | cut -f2 -d":" |
cut -f1 -
d" "`
}
case "$1" in
start)
echo -------------------- >> $LOG
echo `date` >> $LOG
echo -n "Connexion adsl: " >> $LOG
echo -n "Connexion adsl: "
$SBIN/modprobe usb-uhci
sleep $DELAY
$PPPD/pppd >> $LOG &
sleep $DELAY
$CHECKIP/checkip &
$CHECKIP/updatedyndns &
;;
stop)
echo -------------------- >> $LOG
echo `date` >> $LOG
echo -n "Déconnexion adsl: " >> $LOG
killall -w updatedyndns > /dev/null
killall -w checkip > /dev/null
killall -w pppd > /dev/null
sleep $DELAY
$SBIN/modprobe -r usb-uhci
echo Shutting down OK >> $LOG
;;
status)
[ -f /var/run/ppp0.pid ] && echo "ppp0 is up (PID
`cat /var/run/ppp0.pid`)"
getip
[ "$IP" ] && echo "Local IP: $IP"
;;
restart)
echo -------------------- >> $LOG
echo `date` >> $LOG
echo "Reconnexion adsl: " >> $LOG
$0 stop
sleep $DELAY
$0 start
;;
*)
echo "Usage: adsl {start|stop|status|restart}"
exit 1
esac
exit 0
Merci d'avance
-----(Regis Gaidot)-------------------------
Développeur / Infographiste / Administrateur
http://dicut.free.fr
http://myphplinks.free.fr
http://myphpstats.free.fr
---------------------(Powered by Linux)-----
Reply to: