PHP 8.2.30
Preview: admpass.sh Size: 1.17 KB
/proc/thread-self/root/proc/thread-self/root/proc/thread-self/root/usr/local/lsws/admin/misc/admpass.sh

#!/bin/sh

CUR_DIR=`dirname "$0"`
cd $CUR_DIR
CUR_DIR=`pwd`


SUCC=0
cat <<EOF

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

EOF

printf "%s" "User name [admin]: "
read ADMIN_USER
if [ "x$ADMIN_USER" = "x" ]; then
	ADMIN_USER=admin
fi

cat <<EOF

Please specify the administrator's password.
This is the password required to login the administration Web interface.

EOF

while [ $SUCC -eq "0" ];  do
	printf "%s" "Password: "
	stty -echo
	read PASS_ONE
	stty echo
	echo ""
	if [ `expr "$PASS_ONE" : '.*'` -ge 6 ]; then
		printf "%s" "Retype password: "
		stty -echo
		read PASS_TWO
		stty echo
		echo ""
		if [ "x$PASS_ONE" = "x$PASS_TWO" ]; then
			SUCC=1
		else
			echo ""
			echo "[ERROR] Sorry, passwords does not match. Try again!"
			echo ""
		fi
	else
		echo ""
		echo "[ERROR] Sorry, password must be at least 6 charactors!"
		echo ""
	fi
done


# generate password file

ENCRYPT_PASS=`$CUR_DIR/../fcgi-bin/admin_php5 -q $CUR_DIR/htpasswd.php $PASS_ONE`
echo "$ADMIN_USER:$ENCRYPT_PASS" > $CUR_DIR/../conf/htpasswd 
if [ $? -eq 0 ]; then
	echo "Administrator's username/password is updated successfully!"
fi

Directory Contents

Dirs: 0 × Files: 31

Name Size Perms Modified Actions
1.17 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.82 KB lrwxr-xr-x 2026-04-21 10:25:16
Edit Download
1.82 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.06 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
624 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
7.31 KB lr-xr-xr-x 2026-04-17 13:15:13
Edit Download
1.46 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.40 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
732 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
22.96 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
336 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.68 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
766 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
25 B lrw-r--r-- 2026-04-17 13:15:12
Edit Download
6.43 KB lrw-r--r-- 2026-04-17 13:15:13
Edit Download
272 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
103 B lrw-r--r-- 2026-04-17 13:15:12
Edit Download
15.30 KB lrwxrwxr-x 2026-04-16 23:11:34
Edit Download
660 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
5.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
5.65 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.78 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
441 B lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.93 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
37.11 KB lrw-r--r-- 2026-04-17 13:15:12
Edit Download
3.23 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
6.24 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
4.61 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
2.90 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download
1.85 KB lr-xr-xr-x 2026-04-17 13:15:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).