Hi guys,

pppd's persist and maxfail options didn't work very well for me on my
broadband connection. It seems to me that it finishes the 'pty' program
and doesn't try to restart it so it can't retry the connection...

Here's an elegant solution (ie. not a cron job checking the connection
every 5 minutes). It will restart the connection *immediately* when it
disconnects -- unless you disconnected it yourself with Debian's ifdown
utility. Save this script as '/etc/network/if-down.d/persist'
and run 'chmod +x persist':

#!/bin/sh

if [ "$METHOD" = "ppp" ]; then

        # If at this point we no longer have the interface up,
        # the termination was unintentional and we should restore it.
        if ! /sbin/ifconfig $IFACE > /dev/null 2> /dev/null; then
                # setsid is required to launch ifup in a background
                # detached process, thus avoiding the ifdown-ifup-
                # simultaneously deadlock.
                setsid /sbin/ifup $IFACE &
        fi

fi

--

Share and enjoy!

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to