Double hash the password directly in the install script

This commit is contained in:
Adam Warner 2017-05-02 21:36:08 +01:00
parent c8e1e6dc8a
commit a5733508ae
No known key found for this signature in database
GPG key ID: 7C062498C7FA6E49

View file

@ -1413,7 +1413,9 @@ main() {
pw=""
if [[ $(grep 'WEBPASSWORD' -c /etc/pihole/setupVars.conf) == 0 ]] ; then
pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8)
/usr/local/bin/pihole -a -p "${pw}"
hash=$(echo -n ${pw} | sha256sum | sed 's/\s.*$//')
hash=$(echo -n ${hash} | sha256sum | sed 's/\s.*$//')
echo "WEBPASSWORD=${hash}" >> ${setupVars}
fi
fi