diff options
author | James Meyer <james.meyer@operamail.com> | 2009-06-01 03:31:49 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2009-06-01 03:31:49 (GMT) |
commit | 0275dd9b652a2bc4cce6011c49ee5a1595bb8fd0 (patch) | |
tree | ed3f8c3cd91edd93a2af8a0a3fb72e1625314eb9 /abs/core-testing/LinHES-config/mv_common.py | |
parent | 45e93081254e4ff4a8da05b82e79e0645a40bcad (diff) | |
download | linhes_pkgbuild-0275dd9b652a2bc4cce6011c49ee5a1595bb8fd0.zip linhes_pkgbuild-0275dd9b652a2bc4cce6011c49ee5a1595bb8fd0.tar.gz linhes_pkgbuild-0275dd9b652a2bc4cce6011c49ee5a1595bb8fd0.tar.bz2 |
LinHES-config: adding more python modules.
Most things are not python, but network.sh is still used by install.
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_common.py')
-rw-r--r-- | abs/core-testing/LinHES-config/mv_common.py | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_common.py b/abs/core-testing/LinHES-config/mv_common.py new file mode 100644 index 0000000..3ae7edb --- /dev/null +++ b/abs/core-testing/LinHES-config/mv_common.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +import logging, os +import commands +config_file = "mv_config" +data_config = __import__(config_file, globals(), locals(), []) + +def runcmd(cmd): + if data_config.NOOPDEBUG=="FALSE": + pass + else: + cmd = "echo "+cmd + logging.debug(" %s",cmd) + cmdout = commands.getoutput(cmd) + logging.debug(" %s",cmdout) + return cmdout + + +def services(systemconfig): + logging.debug("______Start of services______") + logging.debug("__End services") + +def cp_and_log(srcfile,destfile): + #return + if not os.path.exists(srcfile): + logging.info("%s is not present, skipping...",srcfile) + else: + cmd = ("rsync -arhp %s %s") %(srcfile,destfile) + runcmd(cmd) + + +def add_service(daemon): + logging.info(" Adding service %s",daemon) + +def remove_service(daemon): + logging.info(" Removing service %s",daemon) + +def pacinstall(pkg): + logging.info(" Installing %s",pkg) + #extra pkg check + if pkg == "xine": + pacinstall("xine-ui") + elif pkg == "dvdcss": + pacinstall("libdvdcss") + elif pkg == "webmin": + add_service("webmin") + +def pacremove(pkg): + logging.info(" Removing %s",pkg) + if pkg == "xine": + pacremove("xine-ui") + elif pkg == "dvdcss": + pacremove("libdvdcss") + elif pkg == "webmin": + remove_service("webmin") + + +def reloadfe(): + logging.info(" Reloading frontend") + logging.info(" LOOK Reloading frontend") + #function reloadfe(){ + #PID=`ps -ef |grep mythfrontend|grep -v grep |awk '{print $2 }'` + #/usr/bin/backend_control.sh clearcache behost $dbhost + #if [ x$RESTART_LCD = xtrue ] + #then + #killall -9 mythlcdserver + #fi + #if [ x = x$PID ] + #then + #echo "Mythfrontend not running, will not reload" + #else + #kill -s USR1 $PID + #fi + return + +def restartfe(): + logging.info(" Restarting frontend") + cmd="killall -9 mythfrontend" + runcmd(cmd) + cmd="killall -9 welcome" + runcmd(cmd) + return + +def udev_trigger(): + logging.info(" Triggering udev") + cmd = "udevadm settle" + runcmd(cmd) + cmd = "udevadm trigger" + runcmd(cmd) + cmd = "udevadm settle" + runcmd(cmd) + cmd = "udevadm trigger" + runcmd(cmd) + + |