Debian Codegraph @

extras/saralogin

raw
1 # This script logs in to a dutch gateway called 'sara'
2 # We want to go to the terminal server.
3 #
4 set a 0
5 set b 0
6 print "+++ Trying to login to the sara terminal server +++"
7 loop1:
8 # Wake up sara by sending a lot of 'ENTER's.
9 inc a
10 if a > 10 goto failed1
11 send \r\r
12 # When sara wakes up, it asks "DESTINATION?"
13 expect {
14 "DESTI"
15 timeout 1 goto loop1
16 }
17 # We want destination 'terms'
18 send terms
19 set a 0
20 loop2:
21 # Wake up terminal server
22 inc a
23 if a > 10 goto failed2
24 send \r\r
25 # When terminal server is awake, it prompts with 'sara-vts1>'
26 expect {
27 "sara"
28 timeout 1 goto loop2
29 }
30 exit
31 failed1:
32 print "\nNo answer from gateway"
33 exit
34 failed2:
35 print "\nNo answer from terminal server"
36 exit