diff options
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_ir.py')
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_ir.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/abs/core-testing/LinHES-config/mv_ir.py b/abs/core-testing/LinHES-config/mv_ir.py index efc8a60..b8e9741 100755 --- a/abs/core-testing/LinHES-config/mv_ir.py +++ b/abs/core-testing/LinHES-config/mv_ir.py @@ -3,9 +3,17 @@ import logging, mv_common import os, re , glob from time import time, localtime, strftime import time +import pwd def setup_lirc_links(mythhome): logging.debug(" Creating links for lirc") + try: + mythuid = pwd.getpwnam('mythtv')[2] + mythgid = pwd.getpwnam('mythtv')[3] + except: + logging.critical("* mythuid not found") + mythuid = '1000' + mythgid = '1000' if not os.path.exists(mythhome+"/.mythtv"): logging.debug(" Creating %s/.mythtv",mythhome) try: @@ -13,7 +21,15 @@ def setup_lirc_links(mythhome): except: logging.debug(" Couldn't create .mythtv ") return - os.chown(mythhome+"/.mythtv","mythtv","mythtv") + try: + os.chown(mythhome+"/.mythtv", mythuid, mythgid) + logging.debug("* Couldn't chown of %s", mythhome) + except: + cmd = ''' chown -R mythtv %s/.mythtv''' %mythhome + mv_common.runcmd(cmd) + cmd = ''' chgrp -R mythtv %s/.mythtv''' %mythhome + mv_common.runcmd(cmd) + pass if not os.path.exists(mythhome+"/.mythtv/lircrc"): logging.debug(" Creating symlink for myth lircrc") |