Distributed MythTV Support Script

It has been a long time since I had time to play with my MythTV setup, but now it finally works. It turns out that the biggest hurdle was not to split the functionality, nor to configure the channels (one just has to get one’s head around the way that MythTV looks at receivers, channels and providers…). The big hurdle was that one of my frontends are connected over WiFi.

The issue was that the frontend application was launched before the WiFi connection was established. This resulted in the frontend running some sort of configuration guide each time the system was booted. Having realized the source of the issue, disabled the autostarting of the frontend and added my own autostart script:


#!/bin/bash

TRIES=0

ping 192.168.1.201 -c 1
RES=$?

while [ "$RES" -ne "0" ]
do
sleep 1
ping 192.168.1.201 -c 1
RES=$?

let "TRIES+=1"
if [ "$TRIES" -gt "100" ]
then
exit -1
fi
done

mythfrontend --service

Here, 192.168.1.201 is the IP of the backend. The script ensures that the backend can be pinged before the frontend process is launched. The end result is a stable boot every time.

4 thoughts on “Distributed MythTV Support Script”

  1. Hi,

    sorry to be a nitpick, but this should be much shorter using until instead of while (since you’re using bash)…

    #!/bin/bash

    TRIES=0
    until ping 192.168.1.201 -c 1
    do
    sleep 1
    let “TRIES+=1”
    if [ $TRIES -gt 100 ]
    then
    echo “$(basename $0): too many failed pings, exiting” >&2
    exit 1
    fi
    done

    mythfrontend –service

    #——

    Cheers
    Simon

  2. what does ‘–service’ do?

    i get an ‘Invalid argument: –service’ message using version 0.24.1 on opensuse…

Comments are closed.