OMXPlayer control

can somebody help be figure out how to convert this script into a working function in Node-Red?

# get rid of the cursor so we don't see it when videos are running
setterm -cursor off

# set here the path to the directory containing your videos
VIDEOPATH="/mnt/storage/videos"

# you can normally leave this alone
SERVICE="omxplayer"

# now for our infinite loop!
while true; do
        if ps ax | grep -v grep | grep $SERVICE > /dev/null
        then
        sleep 1;
else
        for entry in $VIDEOPATH/*
        do
                clear
                omxplayer -r $entry > /dev/null
        done
fi
done

Hi @MrDmx1024

For future reference, when pasting code of any sort into this forum you need to put three backticks characters ``` on a newline before and after your code. That tells the forum it's code and shouldn't be reformatted as has happened with your post. I've edited your post this time to fix it up.

Always worth looking on flows.nodered.org

Thank you. Sorry for the noob move