! ! ! OT/PPP connect script for SLiRP via a terminal server ! ! This script is known to work when dialing in to the University of ! Rochester's Xyplex terminal server. YMMV. Distribute freely. ! ! Tom Guptill ! Department of Physics and Astronomy ! University of Rochester ! ! tom@lenin.pas.rochester.edu ! @ANSWER @HANGUP EXIT 0 ! @ORIGINATE ! CHRDELAY 1 ! ! The termserver sometimes needs to be knocked on the head a few times. ! @LABEL 10 NOTE "Trying to wake up the termserver." PAUSE 2 WRITE "\13\13\13\13\13\13\13\13" ! @LABEL 11 ! ! We used to look for Xyplex> here, but not everybody has one. ! You might need to twiddle with this if you have problems. ! MATCHCLR MATCHSTR 1 12 "> " MATCHREAD 300 NOTE "Connect script couldn't match \34> \34" 3 JUMP 99 ! @LABEL 12 ! ! If you always connect to to the same host, you could comment out the ASK stuff and just put in the hostname ! in place of the ^* (caret-star) ! ! Some termservers may need "telnet" instead of "c". I use "c" here because some hosts are best connected to ! using LAT or some other protocol. Xyplex termservers seem to default to telnet if they don't know about any ! other possibilities for a given host name. ! NOTE "Termserver connection established." ASK 0 "Name of SLiRP host?" WRITE "c ^*\13" ! @LABEL 13 NOTE "Logging in..." MATCHCLR ! ! For some hosts (like lenin and most VMS boxes) you need to look for Username: instead of login: ! !MATCHSTR 1 14 "Username:" MATCHSTR 1 14 "login:" MATCHREAD 300 NOTE "Connect script couldn't match \34 login: \34" 3 JUMP 99 ! @LABEL 14 WRITE "^U\13" ! @LABEL 15 MATCHCLR MATCHSTR 1 16 "Password: " MATCHREAD 300 NOTE "Connect script couldn't match \34Password: \34" 3 JUMP 99 ! @LABEL 16 WRITE "^P\13" ! ! ! We used to wait for a prompt here. The hard part was choosing a string to wait for. ! ! There is probably a better way, but this works for now. ! @LABEL 20 PAUSE 2 ! @LABEL 22 NOTE "Starting SLiRP..." PAUSE 1 WRITE "\13\13slirp ppp \34baudrate 19200\34 \34bsdcomp 10\34 \34mtu 256\34\13" ! @LABEL 23 MATCHCLR MATCHSTR 1 90 " Ready ...\13\10" MATCHREAD 300 NOTE "Connect script couldn't match \34 Ready ...\13\10\34" 3 JUMP 99 ! @LABEL 90 PAUSE 1 EXIT 0 ! @LABEL 99 PAUSE 60 EXIT -6002 "Connection script failed."