#!/bin/sh # # Script to initiate a ppp connection to U-M ITD dialin server. # Also requires the 'chat' script named $DIALER_SCRIPT below, # and a ppp/options file with proper options. # # Note: if you run this via sudo, as you should, you may have to enter # your local password (prompt is "Password:") to prove you are # authorized, then your ppp username and remote password. Don't get # confused if asked for two passwords. # # Eric Myers , Dept. of Physics, Univ. of Michigan # @(#) $Id: ppp-um,v 1.6 1999/07/01 14:39:23 myers Exp myers $ ###################################################################### # Defaults and parameters TELEPHONE=489-2222 # New U-M ITD dialin MODEM=/dev/ttyS2 # where is the modem device? # BAUD is speed between computer and modem, so use fastest possible BAUD=115200 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 # 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. DIALER_SCRIPT=/etc/ppp/ppp-um-dialin # Where to log things: PPPLOG=/var/adm/ppp.log ###################################################################### # First argument, if it is give, is the telephone number if [ ! $# -lt 1 ]; then TELEPHONE="$1" fi # Second argument, if given, is the baud rate if [ ! $# -lt 2 ]; then BAUD="$2" fi echo "PPP dial-in on $TELEPHONE" # Rather than leave a password in a file someone might be able # to read, we ask for the ppp password each time the connection # is to be brought up, and turn off the echo while it is entered. echo -n "ppp login: " read ACCOUNT # If ACCOUNT does not contain @ then add the domain: ACCOUNT=$ACCOUNT@umich.edu echo -n "ppp password: " stty -echo read PASSWORD stty echo echo " " # Export them so that they will be available to DIALER_SCRIPT export TELEPHONE ACCOUNT PASSWORD # Mark the log: echo "$0 by $USER to $TELEPHONE on `date`" >>${PPPLOG} 2>&1 ########################### ## Stuff I use for the LAPTOP ONLY # # Turn Ethernet off while using the modem? # /sbin/ifconfig eth0 down >>${PPPLOG} 2>&1 # # Flush any default routes so that pppd can establish a new # one with 'defaultroute' #/sbin/route del default >>${PPPLOG} 2>&1 #/sbin/route del 141.211.96.0 >>${PPPLOG} 2>&1 # # Reset the PCMCIA card (modem) #/sbin/cardctl reset >>${PPPLOG} 2>&1 #/sbin/cardctl status >>${PPPLOG} 2>&1 # ########################### # Turn off the echo on modem serial port stty -echo <${MODEM} & echo "Starting pppd... " # The basic options here get things going, but specific options for # the connection are in the file /etc/ppp/options. # exec /usr/sbin/pppd $MODEM $BAUD $LOCAL_IP:$REMOTE_IP \ connect $DIALER_SCRIPT exit 0