]> git.etc.gen.nz Git - mythtv-epg-nz.git/commitdiff
Allow an external configuration file
authorAndrew Ruthven <andrew@etc.gen.nz>
Sat, 11 Jun 2022 07:59:10 +0000 (19:59 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Sat, 11 Jun 2022 07:59:10 +0000 (19:59 +1200)
bin/do_mhegepgsnoop
etc/do_mhegepgsnoop.conf [new file with mode: 0644]

index 63434bd37514d2fa204129a3b057522316104437..01f14acf4380c0e5f37d8da672ff245fced58060 100644 (file)
@@ -1,23 +1,26 @@
 #!/bin/bash
 
+CONFIG_FILE=/etc/mythtv-epg-nz/do_mhegepgsnoop.conf
+[ -f $CONFIG_FILE ] && . /etc/mythtv-epg-nz/do_mhegepgsnoop.conf
+
 # The sourceid value for your FreeviewHD source.
-SOURCEID=1
+SOURCEID=${SOURCEID:-1}
 
 # Adapter number of DVB-T card.
-ADAPTER=0
+ADAPTER=${ADAPTER:-0}
 
 # DVB-T multiplex frequency (kHz)
-DVB_T_FREQ=610000
+DVB_T_FREQ=${DVB_T_FREQ:-610000}
 
 # Number of times to try mhegepgsnoop.py if it fails.
-TRIES=5
+TRIES=${TRIES:-5}
 
 # Amount of time to sleep between tries.
-SLEEP_TIME=5m
+SLEEP_TIME=${SLEEP_TIME:-'5m'}
 
 # Output file to store the xmltv EPG data.
 TEMP_FILE=/tmp/xmltv.xml
-OUTPUT_FILE=/home/mythtv/.mythtv/freeview.xml
+OUTPUT_FILE=${OUTPUT_FILE:-'/home/mythtv/.mythtv/freeview.xml'}
 
 # Channel map file.
 #MAP_FILE=/home/mythtv/.mythtv/mhegepgsnoop_channel_map.txt
diff --git a/etc/do_mhegepgsnoop.conf b/etc/do_mhegepgsnoop.conf
new file mode 100644 (file)
index 0000000..4efdf93
--- /dev/null
@@ -0,0 +1,20 @@
+# The sourceid value for your FreeviewHD source. To identify, run:
+#
+# mysql -e "select sourceid,name,xmltvgrabber,useeit from videosource order by sourceid" mythconverg
+#
+SOURCEID=1
+
+# Adapter number of DVB-T card. To idenfify, run:
+#
+# mysql -e "select cardid,parentid,videodevice,cardtype,inputname,sourceid,displayname,schedorder,livetvorder from capturecard order by videodevice,cardid" mythconverg
+# 
+ADAPTER=0
+
+# DVB-T multiplex frequency (kHz)
+DVB_T_FREQ=610000
+
+# Number of times to try mhegepgsnoop.py if it fails.
+TRIES=5
+
+# Amount of time to sleep between tries.
+SLEEP_TIME=5m