Getting console access via SC using expect
To get access to a console via the machine's sc, using expect I did the following:
proc ilom3 {} {
send "console -f\r"
expect "\[y/n\]"
send "y\r"
expect "ALOM\."
send "\r"
return 0
}
proc ilom2 {} {
send "stop /SP/console\r"
expect "(y/n)\? "
send "y\r"
expect -re ".+"
send "start /SP/console\r"
expect "(y/n)\? "
send "y\r"
expect "To stop, type ESC ("
send "\r"
return 0
}
expect {
-re "-> " ilom2
-re "sc> " ilom3
}
Posted at
02:36PM Feb 25, 2009
by Felix Baumann in Sun |