xcat-core/xCAT-server-2.0/share/xcat/cons/blade.expect
2007-11-30 15:27:48 +00:00

36 lines
519 B
Plaintext
Executable File

#!/usr/bin/env expect
set timeout 45
set bcmm [lindex $argv 0]
set bayno [lindex $argv 1]
set username [lindex $argv 2]
set password [lindex $argv 3]
set cmdline "console -o -T blade\[$bayno\]"
spawn telnet $bcmm
expect -re ".*username: "
send "$username\r"
expect -re ".*password: "
send "$password\r"
expect -re ".*system> "
send "$cmdline\r"
expect {
eof {
exit
}
-re ".*system> " {
sleep 5
send "$cmdline\r"
}
"?" {
interact {
-o
"system> " {
sleep 5
send "$cmdline\r"
}
}
}
}