Last active
August 29, 2015 14:05
-
-
Save loopymonkey/9bebc889fbdbfb4a7564 to your computer and use it in GitHub Desktop.
pi_player_loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Raspberry pi video player loop | |
# Ross Jeffcoat 2012 | |
# requires omxplayer installed | |
#clears the screen | |
clear | |
#mount usb thumb drive - make sure /media/usbstick/ is already created in root | |
mount -t vfat -o rw /dev/sda1 /media/usbstick/ | |
#loops omxplayer for playlist.mp4 just rename to your file | |
SERVICE ='omxplayer' | |
while true; do | |
if ps ax | grep -v grep | grep $SERVICE > /dev/null | |
then | |
echo 'running' # sleep 1 | |
else | |
clear && tput cup 50 50 && omxplayer -o hdmi /media/usbstick/videos/playlist.mp4 > /dev/null | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment