summaryrefslogtreecommitdiffstats
path: root/abs/core
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2012-09-04 21:36:05 (GMT)
committerBritney Fransen <brfransen@gmail.com>2012-09-04 21:36:05 (GMT)
commitef93372c8ce35aa6ca16c065cc3a64ae4f08d6d6 (patch)
tree2b2e6e90d658b61a0da73f8bc45fde2a8ef2891c /abs/core
parenta53f0abbe6f6d2420bb1bd6f6e517bb2ebe2208c (diff)
downloadlinhes_pkgbuild-ef93372c8ce35aa6ca16c065cc3a64ae4f08d6d6.zip
linhes_pkgbuild-ef93372c8ce35aa6ca16c065cc3a64ae4f08d6d6.tar.gz
linhes_pkgbuild-ef93372c8ce35aa6ca16c065cc3a64ae4f08d6d6.tar.bz2
LinHES-system: misc_status_config.py: add SystemType check and only update db for Standalone and masterbackend
Diffstat (limited to 'abs/core')
-rw-r--r--abs/core/LinHES-system/PKGBUILD4
-rwxr-xr-xabs/core/LinHES-system/misc_status_config.py37
2 files changed, 33 insertions, 8 deletions
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD
index 20a2c67..b5f6ab3 100644
--- a/abs/core/LinHES-system/PKGBUILD
+++ b/abs/core/LinHES-system/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=LinHES-system
pkgver=2
-pkgrel=56
+pkgrel=57
arch=('i686')
MVDIR=$startdir/pkg/usr/LH
BINDIR=$startdir/pkg/usr/bin
@@ -84,7 +84,7 @@ md5sums=('d1a5963c5a440a608031c6d750232633'
'b798ee0796d1b760a2998f90eb8ce9cc'
'4a3cd8f9b33b2b86fdba47a8f1fa2859'
'06a628469051237943b7c874f2e29b8a'
- '0512f859cd5ea1d9eb972840caef2f0e'
+ '54ebcc024db2e0ebe8121305d8926767'
'45f46d1f9193c8dde18e56369ec29a1e'
'a8edbe7bc37e9932e8749d9f5f89c16f'
'14cea9e87654441b766a97576233ba5a'
diff --git a/abs/core/LinHES-system/misc_status_config.py b/abs/core/LinHES-system/misc_status_config.py
index 0a0ba6c..cc82534 100755
--- a/abs/core/LinHES-system/misc_status_config.py
+++ b/abs/core/LinHES-system/misc_status_config.py
@@ -7,9 +7,34 @@ from MythTV import MythDB
mythdb = MythDB()
localhostname = gethostname()
-# mythtv-setup
-if mythdb.settings[localhostname].MiscStatusScript == u'':
- mythdb.settings[localhostname].MiscStatusScript = u'/usr/LH/bin/misc_status_info.sh'
- print 'The MythTV database setting MiscStatusScript was updated to /usr/LH/bin/misc_status_info.sh.'
-else:
- print 'The MythTV database setting MiscStatusScript is already set and will not be updated.'
+# Function to set db setting. This setting is set in mythtv-setup.
+def dbSettingChange():
+ if mythdb.settings[localhostname].MiscStatusScript == u'':
+ mythdb.settings[localhostname].MiscStatusScript = u'/usr/LH/bin/misc_status_info.sh'
+ print 'The MythTV database setting MiscStatusScript was updated to /usr/LH/bin/misc_status_info.sh.'
+ else:
+ print 'The MythTV database setting MiscStatusScript is already set and will not be updated.'
+ return
+
+#taken from systemconfig.py
+#this is how you populate the dict
+systemconfig = {}
+file_name = "/etc/systemconfig"
+try:
+ config_file = open(file_name)
+except:
+ logging.critical("%s could not be opened", file_name)
+ sys.exit(1)
+
+for line in config_file:
+ line = line.strip()
+ if line and line[0] is not "#" and line[-1] is not "=":
+ var, val = line.rsplit("=", 1)
+ val = val.strip('"')
+ systemconfig[var.strip()] = val.strip()
+
+#this is how you reference a value from mv_hostype.py
+if (systemconfig.get("SystemType") == "Standalone"):
+ dbSettingChange()
+elif systemconfig.get("SystemType") == "Master_backend":
+ dbSettingChange()