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

Ian Evans dheianevans at gmail.com
Fri Aug 3 21:26:35 UTC 2012


On Fri, Aug 3, 2012 at 4:36 PM, Bill Meek <keemllib at gmail.com> wrote:
> 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

Okay so this is the script I made and chmod +x'd

*******************************************************
#!/bin/sh

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

if [ $? -eq 0 ]; then
    echo "killall mythfrontend.real"
else
    echo "mythfrontend --service"
fi
*******************************************************

in my myth lirc file I changed the button command from this:

config = killall mythfrontend.real

to this:

config = /usr/share/mythtv/mythstartrestart.sh

Restarted the system and it doesn't work. Did I do something wrong in
the bash script?


More information about the mythtv-users mailing list