[mythtv-users] Scripting help -- check whether mythfrontend is running or not

Robert Tsai rtsai1111 at comcast.net
Tue Nov 22 09:11:32 EST 2005


On Mon, Nov 21, 2005 at 07:50:59PM -0800, 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!

	MYTHFRONTEND_PID=`pgrep -u mythuser mythfrontend`
	if [ -z "$MYTHFRONTEND_PID" ]; then
		# mythfrontend is not running
		...
	else
		# mythfrontend is running
	fi

--Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20051122/f70553b9/attachment.pgp


More information about the mythtv-users mailing list