diff options
author | James Meyer <james.meyer@operamail.com> | 2012-11-03 17:59:45 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-11-03 17:59:45 (GMT) |
commit | 4be23d4482a7aec8820be8fa373bc8de5a0272b5 (patch) | |
tree | 453c78e84078cb6cfa3da1daa4906050aedb68a2 /abs/core/LinHES-config/mv_webuser.py | |
parent | 306d9e4bfa29faaa561d54df14a0533d034f9773 (diff) | |
download | linhes_pkgbuild-4be23d4482a7aec8820be8fa373bc8de5a0272b5.zip linhes_pkgbuild-4be23d4482a7aec8820be8fa373bc8de5a0272b5.tar.gz linhes_pkgbuild-4be23d4482a7aec8820be8fa373bc8de5a0272b5.tar.bz2 |
mythweb, mythexport,zoneminder, web_auth: convert packages to use gen_light_include.conf
refs #864
closes #864
Diffstat (limited to 'abs/core/LinHES-config/mv_webuser.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_webuser.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/abs/core/LinHES-config/mv_webuser.py b/abs/core/LinHES-config/mv_webuser.py index 3e383f2..e349e0b 100755 --- a/abs/core/LinHES-config/mv_webuser.py +++ b/abs/core/LinHES-config/mv_webuser.py @@ -8,16 +8,25 @@ def setup_web_auth(UseMythWEB_auth): return logging.info("____Start of setup_web_auth____") + include_file="/etc/gen_light_conf.d/auth.conf" if UseMythWEB_auth == str(1): - #enable auth logging.info(" Enabling authorization for mythweb") - cmd='''sed -i "s/^.*include.*auth-inc.conf.*$/include \\"\/etc\/lighttpd\/auth-inc.conf\\"/g" /etc/lighttpd/lighttpd.conf''' - mv_common.runcmd(cmd) + try: + fo = open(include_file, "w") + out_string='''include "/etc/lighttpd/auth-inc.conf"''' + fo.write(out_string) + fo.close() + except: + logging.info(" Couldn't open auth include file") + else: #disable auth logging.info(" Disabling authorization for mythweb") - cmd='''sed -i "s/^.*include.*auth-inc.conf.*$/#include \\"\/etc\/lighttpd\/auth-inc.conf\\"/g" /etc/lighttpd/lighttpd.conf''' + cmd="rm -f %s" %include_file mv_common.runcmd(cmd) + logging.debug("Running gen_light_include.py") + cmd="/usr/LH/bin/gen_light_include.py" + mv_common.runcmd(cmd) logging.debug("Restarting lighttpd") cmd="sudo sv restart lighttpd" mv_common.runcmd(cmd) |