#!/bin/bash # # Universial PPP script # # Greatings to : # # Roland of Gilead - You will reach the Dark Tower! # Jake Chambers - Be true # Eddie Dean - Fuck Susannah! # Susannah Dean - Fuck Eddie! # Oy of the Midworld (from Jake) and Kojak (from Glen Batemen) # Abagail Freemantle - We will make our stand! # Randall Flag - Be gentle on Roland ;) # Tom Cullen - M.O.O.N. that spells Tom Cullen # Nick Andros - Welcome home # Ralf Brentner - You hung in there along with Larry # Stu Redman - A little too perfect, but a great guy # Larry Underwood - One of my favorites # Lucy Swann - A little flat character but ok # Glen Bateman - My favorite :) # Judge Ferris - You were a good spy # Franny Goldsmith - In the book better than in the movie. Much better. # Harold Emery Lauder - I have been deceived # Nadine Cross - How i love to love Nadine # Lloyd Heinrich - The right hand of Randall. # The Trashcan Man - I will place you high in my counsil, and i will set you to burn # And all the rest who survived Captain Tripps # Telephone number of your internet provider PHONE=021-123456 # Which comport is your modem on ? # /dev/cua0 = com1, /dev/cua1 = com2 etc. TTY=/dev/cua1 # Modem Speed (Bps) SPEED=57600 # Login name for your Internet Provider LOGIN=tomcullen # Uncomment this and change if you have a static IP. Don't forget the : at the end! #LOCALIP=123.456.78.90: ################################################################# # Don't change anything below here # ################################################################# # Find out the full path to this script. if [ "$1" != "chat" ] then case $0 in ./*) me=`pwd`/$0 ;; /*) me=$0 ;; *) me=`which $0` ;; esac case "$me" in ./*) me=`pwd`/$0 ;; esac fi # Set the path. PATH=/bin:/usr/bin:/sbin:/usr/sbin if [ "$1" = chat ] then chat -v -t 3 gibberish chat -v "" ATZ OK "ATZ" OK if [ $? != 0 ] then echo "chat: could not initialize modem" >&2 exit 1 fi chat -v "" ATM1 OK "ATM1" OK # Now dial the number. chat -v ABORT BUSY ABORT "NO CARRIER" "" ATDT$PHONE CONNECT '\c' if [ $? != 0 ] then echo "chat: dial failed" >&2 exit 1 fi [ "$PASSWD" = "" ] && exit 0 # Now try to login. chat -v "ogin:-\r-ogin:" "\d$LOGIN" assword: $PASSWD if [ $? != 0 ] then echo "chat: login failed" >&2 exit 1 fi [ "$SHELLPROMPT" = "" ] && exit 0 echo echo chat -v "$SHELLPROMPT" "exec /usr/sbin/pppd passive modem crtscts proxyarp asyncmap 0" if [ $? != 0 ] then echo "chat: timeout waiting for shellprompt" >&2 exit 1 fi exit 0 fi [ "$PASSWD" = "" ] && USER="user $LOGIN" /usr/sbin/pppd $TTY $SPEED \ $LOCALIP \ mtu 576 \ mru 576 \ debug \ crtscts \ connect "$me chat" \ lock \ modem \ asyncmap 0 \ defaultroute \ $USER for i in /var/log/messages /var/log/messages/debug.log do if [ -f $i ] then echo "You are now connected. Enjoy :-)" exec tail -f $i fi done