29 |
global board_info |
global board_info |
30 |
|
|
31 |
if [board_info $hostname exists fileid] { |
if [board_info $hostname exists fileid] { |
32 |
unset board_info($hostname,fileid); |
unset board_info($hostname,fileid) |
33 |
} |
} |
34 |
|
|
35 |
if ![board_info $hostname exists spectra] { |
if ![board_info $hostname exists spectra] { |
36 |
perror "No spectra directory for $hostname"; |
perror "No spectra directory for $hostname" |
37 |
return -1; |
return -1 |
38 |
} else { |
} else { |
39 |
set spectra [board_info $hostname spectra]; |
set spectra [board_info $hostname spectra] |
40 |
} |
} |
41 |
|
|
42 |
if ![board_info $hostname exists xsh_shell_prompt] { |
if ![board_info $hostname exists xsh_shell_prompt] { |
43 |
set xsh_shell_prompt ".*> " |
set xsh_shell_prompt ".*> " |
44 |
} else { |
} else { |
45 |
set xsh_shell_prompt [board_info $hostname shell_prompt]; |
set xsh_shell_prompt [board_info $hostname shell_prompt] |
46 |
} |
} |
47 |
|
|
48 |
set retries 0 |
set retries 0 |
49 |
set result 0 |
set result 0 |
50 |
if ![board_info $hostname exists xsh_prog] { |
if ![board_info $hostname exists xsh_prog] { |
51 |
set xsh xsh; |
set xsh xsh |
52 |
} else { |
} else { |
53 |
set xsh [board_info $hostname xsh_prog]; |
set xsh [board_info $hostname xsh_prog] |
54 |
} |
} |
55 |
|
|
56 |
if {[which $xsh] != 0} { |
if {[which $xsh] != 0} { |
121 |
} |
} |
122 |
} |
} |
123 |
|
|
124 |
set board_info($hostname,fileid) $spawn_id; |
set board_info($hostname,fileid) $spawn_id |
125 |
# load to operating system |
# load to operating system |
126 |
set timeout 20 |
set timeout 20 |
127 |
set retries 0 |
set retries 0 |
164 |
perror "Couldn't connect after $retries retries.\n" |
perror "Couldn't connect after $retries retries.\n" |
165 |
return -1 |
return -1 |
166 |
} else { |
} else { |
167 |
set board_info($hostname,fileid) $spawn_id; |
set board_info($hostname,fileid) $spawn_id |
168 |
return $spawn_id |
return $spawn_id |
169 |
} |
} |
170 |
} |
} |
187 |
|
|
188 |
set result 1 |
set result 1 |
189 |
set retries 0 |
set retries 0 |
190 |
set shell_id [board_info $dest fileid]; |
set shell_id [board_info $dest fileid] |
191 |
|
|
192 |
if { [llength $args] > 1 } { |
if { [llength $args] > 1 } { |
193 |
set opts [lindex $args 1] |
set opts [lindex $args 1] |
310 |
global board_info |
global board_info |
311 |
|
|
312 |
if ![board_info $hostname exists fileid] { |
if ![board_info $hostname exists fileid] { |
313 |
return; |
return |
314 |
} |
} |
315 |
|
|
316 |
set shell_id [board_info ${hostname} fileid]; |
set shell_id [board_info ${hostname} fileid] |
317 |
send -i $shell_id "exit\n" |
send -i $shell_id "exit\n" |
318 |
unset board_info(${hostname},fileid); |
unset board_info(${hostname},fileid) |
319 |
|
|
320 |
verbose "Exiting shell." |
verbose "Exiting shell." |
321 |
return 0 |
return 0 |