# Force a specific location for finding the MythTV configuration. If you get error
# messages such as:
# Error accessing mythconverg database with Python bindings
+# Cannot locate your home directory
# then uncomment the next line below and adjust it to point to a directory containing
# a valid config.xml for access to your backend. It needs to be readable by the user
# that is running this script. There is usually one in:
# /etc/mythtv
# /home/<your mythfrontend user>/.mythtv
# /home/mythtv/.mythtv
-#MYTHCONFDIR=/etc/mythtv
+# Using /etc/mythtv is not recommended as the /etc/mythtv directory can then get
+# used for lots of temporary files and directories.
+#export MYTHCONFDIR=/home/mythtv/.mythtv
+
+# Alternatively, if you are running this script from root (eg using epg.service), then
+# you can create a /root/.mythtv/config.xml file, perhaps like this:
+# sudo su; mkdir /root/.mythtv; chown root:root /root.mythtv; cd /root/.mythtv; ln -s /etc/mythtv/config.xml; exit
+
+# If, after doing the abobe, you are still having problems with mhegepgsnoop.py using the
+# Python bindings to access the database, then remove the -p option from its command line and use this instead:
+# -m"-u <UserName> -p<Password>"
+# where the UserName and Password are taken from a working config.xml file. Note that the spaces and lack of them
+# are significant in the -m option. It will not work if you do not follow the above syntax exactly.
retval=0
chmod a+rw $OUTPUT_FILE
mythfilldatabase --only-update-guide --sourceid $SOURCEID --file --xmlfile $OUTPUT_FILE
+ retval=$?
fi
exit $retval