# Script originally From: Vince Quaresima # hacked a bit by me (Chris Fearnley cjf@netaxs.com) # # dipscript.sample Dialup IP connection support program. # This script will automate the /sbin/dip process. # It should be called by typing # /sbin/dip dipscript # from your LINUX prompt. Of course, this assumes # that you rename this file as 'dipscript'. # This file goes in /etc and you should run # /sbin/dip as ROOT after you cd to /etc. # OR you could automate it by putting # /sbin/dip dipscript # as the LAST LINE of your /etc/rc.d/rc.inet2 # file. In that case you will dial in for SLIP # automatically every time you boot up LINUX. # As convenient as this sounds I DO NOT RECOMMEND IT! # Call me whatever you want, I just like to do my # "modem stuff" manually. But then my situation is # different from yours - I can get to my LINUX box # remotely by two different paths even if it isn't # running SLIP. # # Audience: This file is for the use of folks who want to put their # LINUX box on the Internet using a dial-up SLIP connection. # # Warranty: None. It works at k2nesoft.com but that does NOT mean # that it will work anywhere else. But it should. # # Author: Vince Quaresima, K2NE (vince-q@k2nesoft.com) # # Distribution: This file may be freely distributed to anyone who wants it. # provided that it is not modified IN ANY WAY WHATSOEVER # including comment-lines. The end-user of this file is # free to modify it however needed in order to get it to # work, but if this file is to be passed along to someone # else, pass along this original file and not any modified # or customized version. # # AND NOW FOR THE GOOD STUFF.... main: # First of all, set up your name for this connection. # I am called "k2nesoft.k2nesoft.com" - change this to YOUR system-name. # NOTE WELL--There must be an entry for your system-name in /etc/hosts get $local k2nesoft.k2nesoft.com # Next, set up the other side's name and address. # My dial-in machine is called 'annex-mtholly.netaxs.com' # NOTE WELL--There must be an entry for your dial-in machine's system # name in /etc/hosts. Forgetting this is probably THE most # common mistake. get $remote annex-mtholly.netaxs.com # Set the desired serial port and speed. # Unfortunately there is no way to set a speed greater than 38400 port cua0 speed 38400 # Prepare for dialing. send AT\r wait OK 2 send AT&H1\r wait OK 2 # The next line is my modem init string (USR Sportster 14.4) # Yours will (almost certainly) have to be different. send AT&H1&C1&D2&B1&K1&M5\r wait OK 2 if $errlvl != 0 goto modem_trouble # Dial up the service provider. # The phone number should be changed to the one that YOU use... # Substitute as appropriate. dial 1-215-966-7777 # if $errlvl != 0 goto modem_trouble # Didn't work for me cjf # The next command will wait TWO MINUTES for the modem to send a # CONNECT message - if we do not get connected in two minutes # chances are there is a noise problem that will make the connection # unusable, or the modem has not answered the phone and thrown out an # answer carrier - cure is to hit CTRL C and start the script over again. wait CONNECT 120 if $errlvl != 0 goto modem_trouble # We are connected. Login to the system. login: sleep 2 # # The next line waits for the first prompt sent by the service provider. # The wait/send dialog that follows is set up to work for all access numbers # used by NET ACCESS in Philadelphia, PA and Mount Holly, NJ. # If you use a different Internet Service Provider, or if Net Access # changes any prompts used on their ANNEX terminal servers, you will have # to modify the dialog accordingly. # wait quit]: 20 if $errlvl != 0 goto login_error send slip\n wait name: 20 if $errlvl != 0 goto login_error send YOUR_LOGIN_NAME_GOES_HERE\n wait word: 20 if $errlvl != 0 goto password_error send YOUR_PASSWORD_GOES_HERE\n loggedin: # Set up the SLIP operating parameters. # The mtu setting has been a topic of discussion on the netaxs.slip # newsgroup. Use 1006. Some will say to use 1500 instead. Don't. get $mtu 1006 default # Say hello and fire up! done: print CONNECTED $locip ---> $rmtip # For the next command I use CSLIP because our connection uses # VJ(header)Compression. If you do not want to do this just # use SLIP instead of CSLIP. mode CSLIP goto exit login_error: print Trouble waiting for the Login: prompt... goto error password_error: print Trouble waiting for the Password: prompt... goto error modem_trouble: print MODEM TROUBLE: Could not get a response from the modem. error: print CONNECT FAILED to $remote exit: