summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_ir.py
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2015-02-10 18:59:28 (GMT)
committerBritney Fransen <brfransen@gmail.com>2015-02-10 18:59:28 (GMT)
commita29afe5c402098513231cd873544c05147e19b18 (patch)
treed05660c7d415b7bb809d1a73921f5ae87696b92d /abs/core/LinHES-config/mv_ir.py
parente7460ef3cb124fb7149614b348f754e2b4f2f658 (diff)
downloadlinhes_pkgbuild-a29afe5c402098513231cd873544c05147e19b18.zip
linhes_pkgbuild-a29afe5c402098513231cd873544c05147e19b18.tar.gz
linhes_pkgbuild-a29afe5c402098513231cd873544c05147e19b18.tar.bz2
LinHES-config: mv_ir.py: add support for wol-lircrc in remote templates
Diffstat (limited to 'abs/core/LinHES-config/mv_ir.py')
-rwxr-xr-xabs/core/LinHES-config/mv_ir.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/abs/core/LinHES-config/mv_ir.py b/abs/core/LinHES-config/mv_ir.py
index 2f3de08..8eab7b0 100755
--- a/abs/core/LinHES-config/mv_ir.py
+++ b/abs/core/LinHES-config/mv_ir.py
@@ -46,6 +46,16 @@ def setup_lirc_links(mythhome):
else:
logging.debug(" /etc/lircrc does not exist, can not link it")
+ if os.path.exists("/etc/wol-lircrc"):
+ if not os.path.exists(mythhome+"/.wol-lircrc"):
+ logging.debug(" Creating symlink for .wol-lircrc")
+ os.symlink("/etc/wol-lircrc",mythhome+"/.wol-lircrc")
+ else:
+ logging.debug(" %s/.wol-lircrc already present",mythhome)
+ else:
+ logging.debug(" /etc/wol-lircrc does not exist, can not link it")
+
+
def scrub_modules(filename,module):
logging.debug(" scrubbing %s from %s",module,filename)
cmd = '''sed -i -e '/.*#%s/d' %s''' %(module,filename)
@@ -100,6 +110,8 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType,remotebucket):
mv_common.runcmd(cmd)
cmd = "mv /etc/lircrc /etc/lircrc-%s" %currenttime
mv_common.runcmd(cmd)
+ cmd = "mv /etc/wol-lircrc /etc/wol-lircrc-%s" %currenttime
+ mv_common.runcmd(cmd)
cmd = "mv /etc/remote.run /etc/remote.run-%s" %currenttime
mv_common.runcmd(cmd)
if remotebucket == "user":
@@ -128,6 +140,16 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType,remotebucket):
continue
include_file("/etc/lircrc",filename)
+ # include wol-lircrc
+ files = remote_path + "/wol-lircrc*"
+ logging.debug(" Using %s",files)
+ for filename in glob.glob(files):
+ # Ignore subfolders
+ if os.path.isdir (filename):
+ logging.debug(" %s is a dir, skipping",filename)
+ continue
+ include_file("/etc/wol-lircrc",filename)
+
#if remote has a special run file use it.
files = remote_path + "/remote.run*"
logging.debug(" Using %s",files)
@@ -205,7 +227,7 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType,remotebucket):
#cleanup
- cmd = "chmod 755 /etc/lircrc /etc/remote.run"
+ cmd = "chmod 755 /etc/lircrc /etc/wol-lircrc /etc/remote.run"
mv_common.runcmd(cmd)
mv_common.add_service("remotes")
mv_common.add_service("irexec")