Ppp device redial

Aus Bennys Wiki
Wechseln zu: Navigation, Suche

Script:


#!/bin/bash
if !(`ifconfig ppp0 2>/dev/null >/dev/null`)
 then
#       echo "ppp0 seems to be offline... - reconnect"
        pon
        sleep 15
        count=0
        while !(`ifconfig ppp0 2>/dev/null >/dev/null`) && (`test $count -le 10`)
         do
#               echo "ppp0 seems to be still offline... - killing pppd"
                killall pppd
                sleep 10
                killall -9 pppd
                sleep 30
                pon
#               echo $count
                count=`expr $count  + 1`
#
         done
fi

Crontab Eintrag:


# Minute Stunde Tag(Monat) Monat  Tag(Woche)   Kommando
# (0-59) (0-23) (1-31)     (1-12) (1-7; 1=Mo) 
0,30    *       *       *       *       /root/check.sh