!
! InterSLIP gateway script for Cisco terminal server
!
! Label 99 is the general purpose error handler, which beeps
! and pause long enough for the user read the message.
!
! First, we wait for the name prompt
!
!
@originate
note "Waiting for prompt"
matchclr
matchstr 1 1 "Login:"
matchread 50
note "No username prompt"
jump 99
!
! Now, send name and wait for the password promt
!
@label 1
note "Sending user name"
write "^5\13"
matchclr
matchstr 1 2 "Password:"
matchread 50
note "No password prompt"
jump 99
!
! Send the password and wait for either the terminal server
! prompt or an error message
!
@label 2
note "Sending Password"
write "^6\13"
matchclr
matchstr 1 4 ">"
matchstr 2 3 "Access denied"
matchread 120
jump 99
!
! If we got an error message, notify the user and fail
!
@label 3
note "Access denied"
!
! General purpose error handler. Let the message appear,
! beep, and then pause for a second.
!
@label 99
pause 1
sound
pause 60
exit -1
!
! If we've successfully logged in, ask for SLIP mode and
! wait for the reponse. If we get anything except
! "Entering SLIP mode.", assume something went wrong, and fail.
!
@label 4
note "Requesting SLIP"
write "slip\13"
matchclr
matchstr 1 5 "Entering SLIP mode"
matchread 120
note "Cannot invoke SLIP mode"
jump 99
!
! We've entered SLIP mode, so match on the first thing that
! looks like an IP address. If we don't find one, fail.
!
@label 5
matchclr
matchexp 1 6 "[0_9][0_9]*\\.[0_9][0_9]*\\.[0_9][0_9]*\\.[0_9][0_9]*\\."
matchread 120
note "No IP address given"
jump 99
!
! We've found an IP address, so inform MacTCP of it, and
! watch for a number (the MTU size)
!
@label 6
setip "^0"
matchclr
matchexp 1 7 "[0_9][0_9]*"
matchread 120
note "No MTU value"
jump 99
!
! We found the MTU size, so inform MacTCP and exit
! the script successfully.
!
@label 7
setmtu "^0"
exit 0
!
! Answer and Hangup modes are currently unused in gateway
! script, but just for futur compatibility, exit successfully.
!
@answer
@hangup
@exit 0
