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

Re: adsl keep alive script



I use cronjob which checks every minute if ppp0 device is present, and if not 
dials again and send me an email.


0-59 * * * * if ((`/sbin/ifconfig | grep ppp0 | wc -l` != 1 )); then 
/usr/local/bin/dial; echo `ifconfig ppp0` > mail maxim@magnifire.com -s "ADSL 
link re-established"; fi

/usr/local/bin/dial:

/sbin/ifconfig ppp0 down
rm -rf /var/run/pptp/10*
killall -9 pptp
killall -9 pppd
sleep 2
/usr/local/bin/pptp 10.0.0.138 debug user user@IProvider remotename 
"10.0.0.138 RELAY_PPP1" defaultroute netmask 255.0.0.0 mtu 1452 mru 1452 
noauth

It does not handles cases when pppd still runs after you lose a connection.

Maxim

On Thursday 29 November 2001 17:30, Ohad.Levy@infineon.com wrote:
> Hello all,
>
> I'm trying to write a script which will keep my adsl connection up all the
> time.
>
> I tried something like running :
> while 1
> rm -rf /var/run/pp*
>  pptp parameters nodetach &
> end
>
> but from some reason, whenever i ran it, it worked for about 10 minutes,
> and after ten minutes, the pptp was detached and alot of pptp process
> started ( even that the connection was still alive ).
>
> I also wish to enter in the script, that if the modem fails, i could telnet
> it a reboot it under the system menu ( something like telnet with chat,
> maybe netcat).
>
> Anyone wrote something like that?
>
> Thanks,
> Ohad.

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il