summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/misc_status_config.py
diff options
context:
space:
mode:
authorCecil <knoppmyth@gmail.com>2012-09-23 19:31:10 (GMT)
committerCecil <knoppmyth@gmail.com>2012-09-23 19:31:10 (GMT)
commitcafd1e5f46d61c3175d4a3347c65ae79c476c61a (patch)
tree3b82cfb5c5e646861bb551088229f19bfadf8d3b /abs/core/LinHES-system/misc_status_config.py
parent717c1c4f8bd16ddf23688e2b94e529a069f40bc9 (diff)
parent02ed2d32465e5f074eae2bca648c2b344c7a3044 (diff)
downloadlinhes_pkgbuild-cafd1e5f46d61c3175d4a3347c65ae79c476c61a.zip
linhes_pkgbuild-cafd1e5f46d61c3175d4a3347c65ae79c476c61a.tar.gz
linhes_pkgbuild-cafd1e5f46d61c3175d4a3347c65ae79c476c61a.tar.bz2
Merge branch 'testing' of git@linhes.org:linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/LinHES-system/misc_status_config.py')
-rwxr-xr-xabs/core/LinHES-system/misc_status_config.py37
1 files changed, 31 insertions, 6 deletions
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()