#!/depot/path/expect -- # connect to the waste collection service # # Przemek Klosowski # log_user 0 # modems tend to send junk spawn telnet modems.nist.gov set timeout 5 expect_before eof exit expect timeout {send_user "Can't connect to modems.nist.gov\n"; exit}\ -re "Connected to modems.nist.gov" send "ath\r" expect timeout {send_user "Can't get response from modem\n"; exit} \ -re "OK" set timeout 60 send_user ">>>> dialing...\n" send "atdt 963-9438\r" expect timeout {send_user "Dialed up, but no connection\n"; exit}\ -re "CONNECT" send_user ">>>> connected...\n" expect timeout {send_user "Timed out waiting for the PC\n"; exit}\ -re "" send_user ">>>> talking to the PC...\n" send "\r" log_user 1 # keep putting stuff back on screen expect timeout {send_user "Can't get the password prompt\n"; exit} \ -re "Enter password:" send_user ">>>> sending password...\n" send "safety\r" interact