mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-03-03 15:28:28 +00:00
Fix empty password detection (#5935)
This commit is contained in:
commit
f38332409f
1 changed files with 2 additions and 2 deletions
|
@ -1766,7 +1766,7 @@ displayFinalMessage() {
|
|||
if [[ "${#1}" -gt 0 ]]; then
|
||||
# set the password to the first argument.
|
||||
pwstring="$1"
|
||||
elif [[ $(pihole-FTL --config webserver.api.pwhash) == '""' ]]; then
|
||||
elif [[ -n $(pihole-FTL --config webserver.api.pwhash) ]]; then
|
||||
# Else if the password exists from previous setup, we'll load it later
|
||||
pwstring="unchanged"
|
||||
else
|
||||
|
@ -2518,7 +2518,7 @@ main() {
|
|||
# Add password to web UI if there is none
|
||||
pw=""
|
||||
# If no password is set,
|
||||
if [[ $(pihole-FTL --config webserver.api.pwhash) == '""' ]]; then
|
||||
if [[ -z $(pihole-FTL --config webserver.api.pwhash) ]]; then
|
||||
# generate a random password
|
||||
pw=$(tr -dc _A-Z-a-z-0-9 </dev/urandom | head -c 8)
|
||||
pihole setpassword "${pw}"
|
||||
|
|
Loading…
Add table
Reference in a new issue