# 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
