Hi,
I have several boxes spread in my home. I make an update if I am in the mood or want to test something. As I am using a home automation system I thought why not use this to automatically update all my boxes when I am not at home. Telnet or ssh cannot be used directly because they cannot react on the output send by the server. I found that expect as shell is my solution.

Good news is that it works already partly:-)
Bad news is that it only works partly:-(

Here is my script:
Code:
#!/usr/bin/expect -f
set timeout -1
set IPaddress "[lindex $argv 0]"
set Username "user"
set Password "pass"

spawn ssh -y-o "StrictHostKeyChecking no" $Username@$IPaddress
expect "*assword: "
send "$Password\r"
expect ":~#"
send "init 4\r"
expect ":~#"
send "opkg update\r"
expect ":~#"
send "opkg upgrade\r"
expect ":~#"
send "reboot\r"
exit
it works perfectly until it enters "opkg upgrade\r" then it does not wait long enough for the reboot and just finishes. The ip of the box is the first parameter when calling this script.

Anyone an idea?

Ralf