summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_webuser.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-config/mv_webuser.py')
-rwxr-xr-xabs/core/LinHES-config/mv_webuser.py17
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)