Salut tt le monde :)
J'ai trouver ca sur le net :
 
#!/bin/sh
#
# Script de test de la pr�sence de la connexion et de reconnexion en cas
# de coupure

# EXIST=`ps auxww | grep adsl-test | grep -v grep | wc -l`
# if [ $EXIST -gt 1 ]; then
#   echo "adsl-test d�j� en cours : [$EXIST]..."
#   exit
# fi

if [ "$1" = "-d" ]; then
  DEBUG=1
else
  DEBUG=0
fi

PPPD_UP=`/bin/pidof pppd`
IPNUM=`/usr/local/bin/ipnum`
MAXLOOP=6

if [ "$PPPD_UP" = "" ]; then
    TODAY=`LC_TIME=fr_FR date '+%A %d %B %Y � %X'`
    poff adsl
    rm -f /tmp/connex
    rm -f /tmp/fai
    pon adsl
    IT=0
    while [ "$IPNUM" = "" -a $IT -lt $MAXLOOP ]; do
      IT=`expr $IT + 1`
      IPNUM=`/usr/local/bin/ipnum`
      if [ $DEBUG = 1 ]; then
        echo -n "."
      fi
      sleep 1
    done
    if [ $DEBUG = 1 ]; then
      echo
      echo "Reconnexion ADSL le $TODAY, IP = $IPNUM"
    else
      echo "Reconnexion ADSL le $TODAY, IP = $IPNUM" | mail root -s Reconnexion
    fi
fi
 
Alors c peut etre bon ? 
 
aller @+

Répondre à