File: saralogin

package info (click to toggle)
minicom 2.2-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,220 kB
  • ctags: 1,151
  • sloc: ansic: 13,987; sh: 3,589; makefile: 130
file content (36 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This script logs in to a dutch gateway called 'sara'
# We want to go to the terminal server.
#
	set a 0
	set b 0
	print "+++ Trying to login to the sara terminal server +++"
loop1:
	# Wake up sara by sending a lot of 'ENTER's.
	inc a
	if a > 10 goto failed1
	send \r\r
	# When sara wakes up, it asks "DESTINATION?"
	expect {
		"DESTI"
		timeout 1 goto loop1
	}
	# We want destination 'terms'
	send terms
	set a 0
loop2:
	# Wake up terminal server
	inc a
	if a > 10 goto failed2
	send \r\r
	# When terminal server is awake, it prompts with 'sara-vts1>'
	expect {
		"sara"
		timeout 1 goto loop2
	}
	exit
failed1:
	print "\nNo answer from gateway"
	exit
failed2:
	print "\nNo answer from terminal server"
	exit