shell - Bash Script to Loop Through All Videos in a Folder on Raspbian Wheezy -


i have following bash script courtesy of this post:

#!/bin/sh  # rid of cursor don't see when videos running setterm -cursor off  # set here path directory containing videos videopath="/mnt/storage/videos"   # can leave alone service="omxplayer"  # our infinite loop! while true;     if ps ax | grep -v grep | grep $service > /dev/null             sleep 1;     else         entry in $videopath/*                     clear             omxplayer $entry > /dev/null         done     fi  done 

i have changed call omxplayer full screen , output sound so:

omxplayer -r -o hdmi $entry > /dev/null 

but before change preferred settings script seems play first video in folder loops on endlessly. have checked permission on videos , same owned user runs script.

that script wrong. have made updates it. see if works you

#!/bin/sh  # rid of cursor don't see when videos running setterm -cursor off  # set here path directory containing videos videopath="/mnt/storage/videos"   # can leave alone service="omxplayer"  entry in $videopath/*     clear     $service $entry > /dev/null      while ps ax | grep -v grep | grep $service > /dev/null             sleep 5;     done done 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -