Skip to content

Commit 412e1e9

Browse files
committed
webadmin fix
1 parent 6d3f71b commit 412e1e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/webadmin.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ ls_upgrade(){
6060

6161
set_web_admin(){
6262
echo 'Update web admin password.'
63+
local LSADPATH='/usr/local/lsws/admin'
6364
docker-compose exec ${CONT_NAME} su -s /bin/bash lsadm -c \
64-
'echo "admin:$(/usr/local/lsws/admin/fcgi-bin/admin_php* -q /usr/local/lsws/admin/misc/htpasswd.php '${1}')" > /usr/local/lsws/admin/conf/htpasswd';
65+
'if [ -e /usr/local/lsws/admin/fcgi-bin/admin_php ]; then \
66+
echo "admin:$('${LSADPATH}'/fcgi-bin/admin_php -q '${LSADPATH}'/misc/htpasswd.php '${1}')" > '${LSADPATH}'/conf/htpasswd; \
67+
else echo "admin:$('${LSADPATH}'/fcgi-bin/admin_php5 -q '${LSADPATH}'/misc/htpasswd.php '${1}')" > '${LSADPATH}'/conf/htpasswd; \
68+
fi';
6569
}
6670

6771
main(){

0 commit comments

Comments
 (0)