[plug] Dial-up on boot.

Paul Day bonfire at bur.st
Fri Jan 12 18:42:37 WST 2001


I haven't used wvdial for quite a while now, but I'm assuming you can make
it so when it exits, it returns 0 and just dies, in which case you could
wrap it in a little bash script.

So, a quick and nasty way would be to just put it in a wrapper like so:

#! /bin/bash
while true ; do
	wvdial
done

So that if wvdial ever exits, it redials.

A slightly nicer way to do it which does logging of what wvdial sends to
stdout and stops it from redialling over and over if say authentication
dies at your ISP would be something like:

#! /bin/bash
exec < /dev/null >> /var/log/somelogfile 2>&1 3>&1 4>&1
P=1
while true ; do
        sleep $P
        NOW=$SECONDS
	wvdial
        X=`expr $SECONDS - $NOW`
        echo $X
        if [ $X -lt 600 ]; then
		P=`expr $P '*' 2`
        else
                P=1
        fi
done

This way, if it's been less than 10 minutes since it last redialled,
it will double the wait time before trying again.

You can also email yourself with something like:

{ echo "Include some stats if you want" | /usr/mail -s "Connection died" }

after the wvdial line, but it's more useful to put that in
/etc/ppp/ip-up.local and ip-down.local.

PD



On Fri, 12 Jan 2001, Brian Tombleson wrote:

> Pardon the probably stupd question, but I can't seem to get wvdial to dial
> on boot-up of RH6.0/6.2

-- 
Paul Day
Email: bonfire at bur.st    Web: www.bur.st/~bonfire    SMS: mobile at bur.st




More information about the plug mailing list