PPP seup script

PPP seup script

Post by R. Mitchel » Sun, 08 Dec 1996 04:00:00



I found a good setup script for PPP.

[ pppsetup 4K ]
#!/bin/sh
###############################################################################
#
#       PPPSETUP  --  Script to set up pppd
###############################################################################

echo
echo "PPPSETUP"
echo
echo "You have to be root to run this procedure"
echo
echo "answer all that apply and leave blank what does"
echo "not apply....leave blank by hitting [enter]"
echo "                                     press [enter]"
read x
clear

if [ ! `whoami` = "root" ]; then
        echo "You must be root to run this script."
        exit 1
fi

while [ -z "$PHONENUM" ]
do
        echo
        echo "To begin setting up your PPP connection, I need to know a "
        echo "few things.  For starters, what is the phone number of your"
        echo "Internet service provider?"
        echo
        echo "(Note: in the USA, use *70, [comma required!] to turn off call"
        echo " waiting.)"
        echo
        echo -n "Phone number : "
        read PHONENUM
        if [ -z "$PHONENUM" ]; then
                echo "You must enter a phone number!  :)"
                sleep 1
        fi
done

if [ -e "/dev/modem" ]; then
        echo
        echo -n "Found your modem...("
        echo -n `ls -l /dev/modem | cut -b56-80`
        echo ")"
        echo
        DEVICE="/dev/modem"
else
        while [ -z "$DEVICE" ]
        do
                echo
                echo "Secondly, what is the name of your modem device?"
                echo
                echo "     1) /dev/cua0  (COM1: under DOS)"
                echo "     2) /dev/cua1  (COM2: under DOS)"
                echo "     3) /dev/cua2  (COM3: under DOS)"
                echo "     4) /dev/cua3  (COM4: under DOS)"
                echo
                echo -n "Select device : "
                read devnum

                case $devnum in
                        1)
                                DEVICE="/dev/cua0"
                                ;;
                        2)
                                DEVICE="/dev/cua1"
                                ;;
                        3)
                                DEVICE="/dev/cua2"
                                ;;
                        4)
                                DEVICE="/dev/cua3"
                                ;;
                        *)
                                echo "Sorry, $devnum isn't a legal selection."
                                ;;
                esac
        done
fi

while [ -z $BAUDRATE ]
do
        echo
        echo "What baud rate is your modem?"
        echo
        echo "   0)115200    (Yeeeee-HAW!!!           )"
        echo "   1) 38400    (Hangin' ten on the 'net!)"
        echo "   2) 19200    (Better known as 14.4    )"
        echo "   3)  9600    (Kinda pokey, ain'tcha?  )"
        echo "   4)  2400    (God help you.  :>       )"
        echo
        echo -n "Baud rate : "
        read baudnum

        case $baudnum in
                0)
                        BAUDRATE="115200"
                        ;;
                1)
                        BAUDRATE="38400"
                        ;;
                2)
                        BAUDRATE="19200"
                        ;;
                3)
                        BAUDRATE="9600"
                        ;;
                4)
                        BAUDRATE="2400"
                        ;;
                *)
                        echo "Sorry, $baudnum isn't a legal selection."
                        sleep 1
                        ;;
        esac
done

echo
echo "What is the IP address of your Internet provider's nameserver?"
echo
echo "Note: Your service provider's technical support can provide you"
echo "with this information."
echo
echo -n "Nameserver IP : "
read DNSIP

echo >> /etc/resolv.conf
echo "nameserver $DNSIP" >> /etc/resolv.conf

OLDDIR=`pwd`
cd $HOME

echo
echo "Now comes the tough part.  :)  I need to know what your"
echo "dialup system prints to your screen, and I need to know what"
echo "you respond with."
echo
echo "( End with '***')"
echo
echo "ABORT BUSY ABORT 'NO CARRIER' '' ATDT$PHONENUM" > .pppscript
while [ ! "$MESSAGE" = "***" -a ! "$YOUSAY" = "***" ]
do
        echo -n "Dialup server says : "
        read MESSAGE

        if [ "$MESSAGE" = "***" ]; then
                continue
        fi

        echo -n "    ...and you say : "
        read YOUSAY

        if [ "$YOUSAY" = "***" ]; then
                continue
        fi

        echo "$MESSAGE $YOUSAY" >> .pppscript
done

rm -f ppp-go
echo "#!/bin/sh" > ppp-go
echo "/usr/sbin/pppd connect '/usr/sbin/chat -f $HOME/.pppscript' defaultroute $BAUDRATE $DEVICE &" >> ppp-go
chmod 755 ppp-go

cd $OLDDIR
echo
echo "To connect to your remote system, cd to your home directory ($HOME), and type:"
echo "./ppp-go"
echo
echo "Then wait 2 minutes or so.  You should be able to use your Internet applications"
echo "without a problem.  (Hopefully. ;)"
echo
echo "You should only have to run this procedure ounce unless something changes"
echo "with your provider or personal setup. To start PPP from here on out just"
echo "type from your home dir ppp-go"
echo
echo "If your pppd and chat bins reside someplace other than"
echo "/usr/sbin then you will need to edit the ppp-go and .pppscript"
echo "files to reflect the location, usually /usr/lib/ppp for older"
echo "distributions like Slackware-2.*"
echo
echo "I can be reached via email at wing...@infohwy.com "
echo "or in the #linux channel on IRC with the nick WingMan"

[ pppsetup.README < 1K ]
This is a great PPPD/CHAT setup shell script I got off from IRC. I have no
idea who wrote it. It's simple and quick. Check it out!

Description:
        PPPSetup is a simple little shell script that will setup a pppd/chat
script to dial up, login to, and initiate a PPP session with a internet
provider.

Installation:
        Download it to any dir you want (preferably your home dir) and type
"chmod 775 pppsetup". To run it, type "./pppsetup". (Obviously)

Uploaded by Matt_Finne...@jackson.cc.mi.us

 
 
 

1. Scripts for ppp-on, ppp-on-dialer, ppp-off

Help-

I apologize for the organization of this email.  I have read many of the
responses and would like to say that I have found the responses to be the
most straightforward and informative.  RCN is my ISP.  The WvDial script
works fine via gnome from one of  my other linux machines.  How do I get
this script to work using PPP.  I thought it would be easier if I provided
the site which provided the information for editing the necessary files and
scripts at the RCN site.  I hope I have not asked too much of you.  I need
the assistance of someone who really knows what they are doing.  I thought
connecting to my ISP would be a simple matter.

WvDial: Internet dialer version 1.41
Initializing modem.
Sending ATZ
ATZ
OK
Sending: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
OK
Sending: ATM0
ATM0
OK
Modem initialized.
Sending: ATDT 2128428111
Waiting for carrier.
ATDT 2128428111
CONNECT 115200
Carrier detected.  Waiting for prompt.

** Ascend TNT2.NYW.EROLS.NET Terminal Server **

Login: Looks like a login prompt.
Sending: 'myloginname'
'myloginname'
Password: Looks like a password prompt.
Sending: (password)

Basically, this is the script that works while using gnome to connect to my
ISP.

This is the script I was told to create in order to connect to my ISP using
PPP.

The site where this information is located is:
http://www.rcn./support/internet/linux/faq/general/the_files/the_file...

I am new to Linux, so I don't quite know what I am doing.  I have wondered
why the script which works for gnome does not work for pppd.

--
Posted via CNET Help.com
http://www.help.com/

2. Automatic Proxy Configuration in NS

3. PPP Question (ppp-on script)

4. a technical question

5. Win95 PPP client script help needed --> SCO-5 dynamic inbound PPP

6. tsx-11.mit.edu Linux

7. PPP and PPP and PPP and PPP and PPP and HEADACHE

8. DNS Configuration

9. ppp-on and ppp-on-dialer scripts

10. Can't Get PPP Working - Chat (ppp-on) script won't dial

11. ppp-up and ppp-down scripts

12. Another ipfwadm question regarding ppp-on and ppp-off scripts

13. How to 'WAIT' in ppp ppp-on-dialer script?