xcat-core/xCAT-server-2.0/usr/share/xcat/cons/blade.expect
jbjohnso c99d72a179 Initial xCAT 2.0 import
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2007-10-26 22:44:33 +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"
}
}
}
}