=================
The scripts assume the following:
- An fstab entry for /dev/sda1 pointing to /mnt/usb-update
-- Binary and scripts live in /home/pi/hdmi-switcher
+- Binary, scripts and public.pem all live in /home/pi/hdmi-switcher
The usb-update script will naively look to see if /dev/sda1 exists. If it does, it mounts it and then copies over any files on the drive with names config.ini, video.mp4 to the cwd.
If you want to run the script on boot, you should use start.sh. start.sh runs the usb-update script, and then starts playing video.mp4 on a loop. It uses omxplayer (make sure whatever version you use has the --loop option). I would suggest simply adding the following to /etc/init.d/rc.local:
```
-cd /home/pi/hdmi-switcher
/home/pi/hdmi-switcher/start.sh
```
if [[ -e "/mnt/usb-update/config.ini" ]]; then
printf "Found config.ini... "
- (cp /mnt/usb-update/config.ini /home/pi > /dev/null 2>&1 && printf "\tCopy OK\n") || printf "\tCopy failure\n"
+ (cp /mnt/usb-update/config.ini /home/pi/hdmi-switcher > /dev/null 2>&1 && printf "\tCopy OK\n") || printf "\tCopy failure\n"
fi
if [[ -e "/mnt/usb-update/video.mp4" ]]; then
printf "Found video.mp4... "
- (cp /mnt/usb-update/video.mp4 /home/pi > /dev/null 2>&1 && printf "\tCopy OK\n") || printf "\tCopy failure\n"
+ (cp /mnt/usb-update/video.mp4 /home/pi/hdmi-switcher > /dev/null 2>&1 && printf "\tCopy OK\n") || printf "\tCopy failure\n"
fi
if [[ -e "/mnt/usb-update/update.zip" ]] && [[ -e "/mnt/usb-update/update.sig" ]]; then