summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_ir.py
diff options
context:
space:
mode:
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")