Using expect script to power on IBM blades

#!/usr/bin/expect -f
spawn ssh root@bcmm.liho.tw
expect “password:”
send “PASSWORD\r”
expect “system>”
send “power -on -T system:blade\[1\]\r”
expect “system>”
send “power -on -T system:blade\[2\]\r”
expect “system>”
send “power -on -T system:blade\[3\]\r”
expect “system>”
send “power -on -T system:blade\[4\]\r”
expect “system>”
send “power -on -T system:blade\[5\]\r”
expect “system>”
send “power -on -T system:blade\[6\]\r”
expect “system>”
send “power -on -T system:blade\[7\]\r”
expect “system>”
send “power -on -T system:blade\[8\]\r”
expect “system>”
send “power -on -T system:blade\[9\]\r”
expect “system>”
send “power -on -T system:blade\[10\]\r”
expect “system>”
send “power -on -T system:blade\[11\]\r”
expect “system>”
send “power -on -T system:blade\[12\]\r”
expect “system>”
send “power -on -T system:blade\[13\]\r”
expect “system>”
send “power -on -T system:blade\[14\]\r”
expect “system>”
send “exit\r”

Leave a Reply

Your email address will not be published. Required fields are marked *