--
So far I have accomplished the following:
-Disabled X11 on boot
-Enabled auto-login in console
-Configured auto-run in bash
-Made a loop script that runs on startup
So now you turn on the PI, it boots, and immediately starts playing the video file in a loop forever, and looks great.
Then next trick is updating it. Here is my current loop script (taken from these forums originally), with no updating.
Code: Select all
#!/bin/sh
SERVICE='omxplayer'
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "running" # sleep 1
else
omxplayer -o hdmi /home/pi/test.mp4 &
fi
done
Code: Select all
#!/bin/sh
SERVICE='omxplayer'
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "running" # sleep 1
else
rm /home/pi/pi.txt.old
mv /home/pi/pi.txt.new /home/pi/pi.txt.old
wget http://www.website.net/pi.txt /home/pi/pi.txt.new
diff –s /home/pi/pi.txt.old /home/pi/pi.txt.new > result
if statement to determine if the files were different, and if they are*
wget http://www.website.net/pi.zip /home/pi/pi.zip
rm –rf /home/pi/*.mp4
unzip pi.zip
rm pi.zip
fi
omxplayer -o hdmi *.mp4 &
fi
done
This is pseudo code btw, it will not run obviously, I probably have a few switches wrong and im not sure how I am going to grep the output of diff to see if they were the same yet.
Thoughts? Should I fight with SSH RSA keypairs and rsync over 50 devices? Should I use a scheduled cron task and find a way for it to kill playback during update? Am I insane? Is there a much better and easier way to do this?