quick fix to web password regression, probably not greatest fix but it works
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
parent
119999be71
commit
20e8ce208c
|
@ -25,7 +25,8 @@ prepare_configs() {
|
|||
sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;/INSTALL_WEB_SERVER/d;/INSTALL_WEB_INTERFACE/d;/LIGHTTPD_ENABLED/d;' "${setupVars}"
|
||||
local USERWEBPASSWORD="${WEBPASSWORD}"
|
||||
. "${setupVars}"
|
||||
export WEBPASSWORD="${USERWEBPASSWORD}"
|
||||
# Stash and pop the user password to avoid setting the password to the hashed setupVar variable
|
||||
WEBPASSWORD="${USERWEBPASSWORD}"
|
||||
fi
|
||||
# echo the information to the user
|
||||
{
|
||||
|
@ -225,19 +226,19 @@ setup_web_port() {
|
|||
}
|
||||
|
||||
setup_web_password() {
|
||||
if [ -z "${WEBPASSWORD+x}" ]; then
|
||||
if [ -z "${WEBPASSWORD+x}" ] ; then
|
||||
# Not set at all, give the user a random pass
|
||||
WEBPASSWORD=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8)
|
||||
echo "Assigning random password: $WEBPASSWORD"
|
||||
fi;
|
||||
# Turn bash debug on while setting up password (to print it)
|
||||
set -x
|
||||
if [[ "$WEBPASSWORD" == "" ]]; then
|
||||
if [[ "$WEBPASSWORD" == "" ]] ; then
|
||||
echo "" | pihole -a -p
|
||||
else
|
||||
pihole -a -p "$WEBPASSWORD" "$WEBPASSWORD"
|
||||
fi
|
||||
if [ "${PH_VERBOSE:-0}" -gt 0 ]; then
|
||||
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
|
||||
# Turn bash debug back off after print password setup
|
||||
# (subshell to null hides printing output)
|
||||
{ set +x; } 2>/dev/null
|
||||
|
|
4
start.sh
4
start.sh
|
@ -12,8 +12,8 @@ export DNS1
|
|||
export DNS2
|
||||
export INTERFACE
|
||||
export IPv6
|
||||
export WEBPASSWORD
|
||||
export WEB_PORT
|
||||
export PLAINWEBPASSWORD="$WEBPASSWORD"
|
||||
|
||||
export adlistFile='/etc/pihole/adlists.list'
|
||||
|
||||
|
@ -31,7 +31,7 @@ prepare_configs
|
|||
change_setting "IPV4_ADDRESS" "$ServerIP"
|
||||
change_setting "IPV6_ADDRESS" "$ServerIPv6"
|
||||
setup_web_port "$WEB_PORT"
|
||||
setup_web_password "$WEBPASSWORD"
|
||||
setup_web_password "$PLAINWEBPASSWORD"
|
||||
setup_dnsmasq "$DNS1" "$DNS2" "$INTERFACE"
|
||||
setup_php_env
|
||||
setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
|
||||
|
|
Loading…
Reference in New Issue