Quote:

I also used expect to modify my hijack Makefile - I modified the 'install' target to call an expect script that would ftp hijack to my player and reboot it if successful.


My install script does something similar, but without expect. It actually performs a full readback of the kernel from flash and compares with the original to ensure correct flash contents before rebooting:

Quote:

echo "Sending kernel.."
ftp -n >/dev/null <<-EOF
open $IP

#passive
site popup 99 Downloading kernel..
put $ZIMAGE /proc/empeg_kernel
site popup 99 Waiting for readback..
get /proc/empeg_kernel /tmp/junk
site popup 0 Done.
quit
EOF
bytes=`ls -l $ZIMAGE|awk '{print $5}'`
dd if=/tmp/junk bs=$bytes count=1 2>/dev/null | diff $ZIMAGE -
if [ "$?" = "0" ]; then
echo "Success!"
else
echo "FAILED -- try again!"
exit 1
fi
rm -f /tmp/junk 2>/dev/null
echo "Rebooting.."
ftp >/dev/null <<-EOF
open $IP

site reboot
EOF