#trace on # # set up some strings for dialling up # if ![load $number] if [query $number "Enter the server telephone number"] save $number end end if ![load $username] username "Enter your authentication username" save $username end if ![load $password] password "Enter your authentication password" end if ![load $modemsetup] display "Using default modem setup"\n $modemsetup = "&c1" end $prompt = ">" $userprompt = "sername:" $passprompt = "assword:" $slipcmd = "slip" $pppcmd = "ppp" %attempts = 10 # # #---------------------------------------------------------- # # initialize modem # output "at&f"\13 if ! [input 10 OK\n] display "Modem is not responding"\n abort end # # setup our modem commands # output "at"$modemsetup\13 input 10 OK\n # # send phone number # %n = 0 repeat if %n = %attempts display "Too many dial attempts"\n abort end output "atdt"$number\13 %ok = [input 60 CONNECT] %n = %n + 1 until %ok input 10 \n # # wait till it's safe to send because some modem's hang up # if you transmit during the connection phase # wait 30 dcd # # wait for the username prompt # input 30 $userprompt output $username\13 input 10 $passprompt output $password\13 input 60 $prompt if %ppp # # jump into ppp mode # output $pppcmd\13 input 30 \n display "PPP mode selected."\n # else # # jump into slip mode # output $slipcmd\13 input 30 \n display "SLIP mode selected."\n end # # Request BootP configuration # bootp