From owner-freebsd-questions Sun Feb 2 16:14:48 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA22834 for questions-outgoing; Sun, 2 Feb 1997 16:14:48 -0800 (PST) Received: from atlantis.nconnect.net (root@atlantis.nconnect.net [206.54.227.6]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA22817 for ; Sun, 2 Feb 1997 16:14:40 -0800 (PST) Received: from arabian.astrolab.org (dial35.nconnect.net [206.54.227.35]) by atlantis.nconnect.net (8.8.4/8.7.3) with SMTP id SAA28217; Sun, 2 Feb 1997 18:07:11 -0600 (CST) Message-ID: <32F52D88.167EB0E7@nconnect.net> Date: Sun, 02 Feb 1997 18:12:56 -0600 From: Randy DuCharme Organization: Computer Specialists X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 3.0-SMP i386) MIME-Version: 1.0 To: Robert Chalmers CC: bsd Subject: Re: getting pppd to work? References: <199702022330.JAA02290@nanguo.chalmers.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Robert Chalmers wrote: > < snip !> This is what I'm using. It works well for me most of the time. I'm still playing with it tho' as sometimes after I terminate a connection, I can't re-connect without some major pounding . ppp-on-------------------------------------------------------------- #!/bin/sh # # Script to initiate a ppp connection. This is the first part of the # pair of scripts. This is not a secure pair of scripts as the codes # are visible with the 'ps' command. However, it is simple. # # These are the parameters. Change as needed. TELEPHONE=1234567 ACCOUNT=< account > PASSWORD=< password > LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0 REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0 NETMASK=255.255.255.0 # The proper netmask if needed # # Export them so that they will be available at 'ppp-on-dialer' time. export TELEPHONE ACCOUNT PASSWORD # # This is the location of the script which dials the phone and logs # in. Please use the absolute file name as the $PATH variable is not # used on the connect option. (To do so on a 'root' account would be # a security hole so don't ask.) # DIALER_SCRIPT=/etc/ppp/ppp-on-dialer # # Initiate the connection # exec /usr/sbin/pppd debug lock modem crtscts asyncmap 1 /dev/cuaa1 57600 \ kdebug 0 $LOCAL_IP:$REMOTE_IP \ netmask $NETMASK connect $DIALER_SCRIPT & ppp-on-dialer-------------------------------------------------------- #!/bin/sh # # This is part 2 of the ppp-on script. It will perform the connection # protocol for the desired connection. # exec chat -v \ TIMEOUT 3 \ ABORT '\nBUSY\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' \rAT \ 'OK-+++\c-OK' ATH0 \ TIMEOUT 30 \ OK ATDT$TELEPHONE \ CONNECT '' \ ogin:--ogin: $ACCOUNT \ assword: $PASSWORD ppp-off ----------------------------------------------------------- #!/bin/sh pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'` if [ X${pid} != "X" ]; then echo 'killing pppd, PID=' ${pid} kill -9 ${pid} fi ifconfig ppp0 down ifconfig ppp0 delete exit 0 Randall D. DuCharme email: randyd@nconnect.net Systems Engineer Free your Machine Computer Specialists **** FreeBSD **** 414-259-9998 414-253-9919 (fax) Turning PCs into Workstations