diff options
Diffstat (limited to 'abs/mv-core')
-rw-r--r-- | abs/mv-core/MythVantage-config/myth_user_call | 14 | ||||
-rwxr-xr-x | abs/mv-core/MythVantage-config/systemconfig.sh | 14 |
2 files changed, 25 insertions, 3 deletions
diff --git a/abs/mv-core/MythVantage-config/myth_user_call b/abs/mv-core/MythVantage-config/myth_user_call index d95e468..0f899df 100644 --- a/abs/mv-core/MythVantage-config/myth_user_call +++ b/abs/mv-core/MythVantage-config/myth_user_call @@ -1,4 +1,4 @@ -#!/bin/bash +GGGGGGGGG#!/bin/bash #Wrapper script to manage USERNAME accounts + web security # myth_USERNAME_all -c add -u USERNAME # myth_USERNAME_all -c delete -u USERNAME @@ -63,7 +63,14 @@ function pass_change() { function web_security { - echo "this is just a stub" + + grep -q ${USERNAME}: /etc/lighttpd/lighttpd.user + if [ $? = 0 ] + then + #delete user + sed -i "/${USERNAME}\:/d" /etc/lighttpd/lighttpd.user + fi + echo "${USERNAME}:${PASSWORD}" >> /etc/lighttpd/lighttpd.user } @@ -155,7 +162,8 @@ case $OPERATION in then print_help fi - echo "adding webUSERNAME $USERNAME with $PASS" + echo "adding webUSERNAME $USERNAME with pass $PASSWORD" + web_security ;; *) print_help ;; diff --git a/abs/mv-core/MythVantage-config/systemconfig.sh b/abs/mv-core/MythVantage-config/systemconfig.sh index 4885f5a..6971e8f 100755 --- a/abs/mv-core/MythVantage-config/systemconfig.sh +++ b/abs/mv-core/MythVantage-config/systemconfig.sh @@ -968,6 +968,18 @@ do done } +function setup_web_auth { + if [ x$UseMythWEB_auth = x1 ] + then + #enable auth + sed -ie "s/^.*include.*auth-inc.conf.*$/include \"\/etc\/lighttpd\/auth-inc.conf\"/g" /etc/lighttpd/lighttpd.conf + else + #disable auth + sed -ie "s/^.*include.*auth-inc.conf.*$/#include \"\/etc\/lighttpd\/auth-inc.conf\"/g" /etc/lighttpd/lighttpd.conf + fi + sudo sv restart lighttpd + +} #----------------------------------------------------MAIN PROGRAM------------------------------------------- #misc,sleep,hostype,advanced,audio @@ -999,6 +1011,8 @@ do ;; advancedX) showX="true" ;; + webuser) setup_web_auth + ;; restartfe) killall -9 mythfrontend killall -9 mythwelcome exit 0 |