#!/usr/bin/expect -f

set timeout -1

spawn telnet zaphod 2016
set tel $spawn_id

while {1} {

	spawn rst x
	expect eof
	wait

	set spawn_id $tel

	expect Download

	spawn bootit
	expect eof
	wait

	set spawn_id $tel

	expect "ogin:"
	send "root\r"

	expect "rd:"
	send "brecis\r"

	expect "#"

	send "mount -n -t jffs2 /dev/mtdblock0 /flash\r"
	expect "#"

	send "cd /flash\r"
	expect "#"

#	send "sleep 20\r"
#	expect "#"

	send "checkfs\r"
	expect "Sending Power down"

	set timeout 30

	expect "NEVER FIND THIS"

}