mylo78 - 2006-12-15

i posted the below to the general forum by accident, ooops.

hey,

I've been asked to continuously play an mp3, even after the power goes out. So I'm thinking I'd like to set up a cronjob to check on the mp3blaster process, if it isn't running, start one. Also, the output is the soundcard. So far I haven't been able to do it.

Any help would be appreciated :)

#!/bin/bash
# $COMMAND is the command used to create the reverse ssh tunnel
COMMAND='mp3blaster -R myMP3file.mp3'

# Is the tunnel up?
CHECK_BLAST=`ps -eo args | grep "$COMMAND" | grep -v grep`

# If the program is not up, create the music!
if [ -z "$CHECK_BLAST" ] ; then
$COMMAND
fi

crontab entry is
* * * * * /where/myMP3baster.script.is.sh >/dev/null