[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatische DSL-Wiedereinwahl



Am 13.12.2002 um 15:49:19 CET, schrub Alexander Grümmer:
 
> #!/bin/sh
> while [ 1 -eq 1 ]; do
> if [ -e "$1" ]; then

was ist $1 ?

>         echo "ist da" /dev/null
> else
>         ( echo "To: ice@thesurf.no-ip.com"
>           echo "From: system"
>           echo "Subject: DSL Link watch"
>           echo "Der DSL Link war unten restarte DSL System"
>         ) 2>&1 | /usr/lib/sendmail -t
>         poff
>         pon dsl-provider
>         ping -c 5 www.heise.de
> fi
> sleep 120

und dann $1 ?

> done
> 
> und schon tut es das und du bekommst sogar noch eine mail :)

Cron schickt auch Mails ;-)

Meine Variante:
------------------------8<-----------------8<-------------------------
#/bin/sh
ifconfig=/sbin/ifconfig
grep=/bin/grep
awk=/bin/awk
touch=/bin/touch
date=/bin/date
pppd=/usr/sbin/pppd
ps=/bin/ps
a=`$ifconfig | $grep ppp0 | $awk '{print $1}'`
if [ \"$a\" != \"ppp0\" ];then
kill `$ps ax|$grep pppd|$grep call|$awk '{print $1}'`
$pppd call 1und1-dsl
$touch /var/log/dsl_reload
echo "`$date` Verbindung aktiviert">>/var/log/dsl_reload
#else
#echo "`date` Verbindung bestand bereits">>/var/log/dsl_reload
fi
exit 0
------------------------8<-----------------8<-------------------------

Wird per Cron jede Minute durchlaufen
-- 
Gruß
Frank



Reply to: