Add web password support

This commit is contained in:
diginc
2017-02-08 22:46:46 -06:00
parent 0eb410ae31
commit 907d36ae9b
4 changed files with 30 additions and 1 deletions

View File

@@ -108,6 +108,14 @@ setup_php_env_alpine() {
cat "$PHP_ENV_CONFIG"
}
setup_web_password() {
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;
pihole -a -p "$WEBPASSWORD"
}
setup_ipv4_ipv6() {
local ip_versions="IPv4 and IPv6"
if [ "$IPv6" != "True" ] ; then