[mythtv-users] Foolproof Mythbuntu start/restart irexec command

Bill Meek keemllib at gmail.com
Fri Aug 3 20:36:24 UTC 2012


On 08/03/2012 02:52 PM, Ian Evans wrote:
...
 > So again, the logic for the script is "If it's it running, killall
> mythfrontend.real (so Mythbuntu then restarts it) and if it's not
> running at all start it." but I don't know how to write bash.

Hi;

Run this with the FE running and not running. If the output
matches what you expect, replace the echos with your restart
and start-up commands.

#!/bin/sh

pgrep mythfrontend.real 2>&1 > /dev/null

if [ $? -eq 0 ]; then
     echo "Already running, put restart command here."
else
     echo "Not running, put your start-up command here"
fi

-- 
Bill



More information about the mythtv-users mailing list