cardboil wrote:
I'd like to write a little script and attach it to my one of my remote control keys. However, I only want the commands to execute when mythfrontend is NOT running. Can someone help me write the IF statement that will check whether mythfrontend is running or not? Thank you!
This will kill mythfrontend if it's running, or start it if it's not:

#!/bin/bash
PROG=mythfrontend
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`

if [ $STATUS -eq 0 ]
then
   ( $PROG & )
else
   killall $PROG
fi
exit 0
_______________________________________________
mythtv-users mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to