Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

fully automatic remote update

Trial

Moderator
Joined
Jul 27, 2011
Messages
5,174
Reaction score
27
Points
48
Age
65
Location
germania
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
 
Andy posted a command a few years ago which won't get interrupted. I'll ask him, if he remembers.

PLi's options for restoring defaults to yes and has a time-out. If we changed to this, you can flash and restore.
 
Hi,
this will not help me. I need an external upgrade feature as all my boxes are on a switchable power plug and my home automation software should switch on, upgrade and switch off.

Ralf
 
Hi,
this will not help me. I need an external upgrade feature as all my boxes are on a switchable power plug and my home automation software should switch on, upgrade and switch off.

Ralf
Init 42 in a Cron job?

Sent from my ONEPLUS A6003 using Tapatalk
 
Hi,
boxes are not connected to power so cron impossible.

Ralf
 

OpenViX Feeds Status

Back
Top