Date: Sun, 02 Feb 1997 18:12:56 -0600 From: Randy DuCharme <randyd@nconnect.net> To: Robert Chalmers <robert@nanguo.chalmers.com.au> Cc: bsd <freebsd-questions@freebsd.org> Subject: Re: getting pppd to work? Message-ID: <32F52D88.167EB0E7@nconnect.net> References: <199702022330.JAA02290@nanguo.chalmers.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32F52D88.167EB0E7>