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.