On Mon, Sep 10, 2001 at 07:52:30PM -0400, [EMAIL PROTECTED] wrote:
> Is there anyway to automatically redial dropped connections without using '-auto' or
>'-ddial'. When I use these, they require outgoing packets to be sent before the
>device comes up, and it is a remote computer, so I need it to be brought up soon as
>the pppd is started. I did try ddial, but it never came up, and I even tried sending
>packets. I was thinking about maybe a cron script that would check to see if device
>'tun0' is up, and if it isn't to redial the connection. Do you think that this is
>possible?
Possible ? yes...but not a very good idea I think because sometimes the
interface is up whereas the connection is broken. So it would be better to
ping one (or two...) ip adress which is always up.
> Please help me :) Also, I have a command that I am trying to execute through
>'ppp.conf' (! /usr/local/sbin/ddup --host chrome.ath.cx) Is that the right format
>for it to be executed, because it is not working when the connection is dialing.
>
Have a look to this piece of code, maybe it can help you:
____________________________________________________________________
#!/bin/sh
ping_host="217.12.6.16" # one ip of yahoo.fr
log_file="/var/log/reconnect.log"
while ((1))
do
# testing the connection ....
ping -c10 $ping_host > /dev/null 2>&1
if [ $? -gt 0 ]; then # not connected ...
# logs
date >> $log_file
# cleaning
/bin/killall pppd 2&>/dev/null
/bin/rm -f /var/run/ppp*.pid 2&>/dev/null
/etc/rc.d/nice.sh 2&>/dev/null # firewall down
sleep 3
# reconnection
pppd call adsl # dialing
sleep 30
/etc/rc.d/fw.sh 2&>/dev/null # firewall up
fi
# the test is done every 30 seconds
sleep 30
done
# faudrait pas en arriver la ...
exit 1
_______________________________________________________________________
This script is made to run in background permanently. So you can add it to
your rc.local.
You can add your ip-updating stuff to it.
For ip-update with dyndns I use "ez-ipupdate" which runs tests and update
the ip adress automatically.
--
http://rhizome.reynerie.yi.org
http://artists.mp3s.com/artists/180/rhz.html
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe