Skip to content

Commit

Permalink
Try to use the CLI password for logins (if enabled and readable by th…
Browse files Browse the repository at this point in the history
…e current user)

Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Jun 19, 2024
1 parent 3306095 commit 18e240c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,15 @@ TestAPIAvailability() {
}

LoginAPI() {
# Try to authenticate
Authenticate
# Try to read the CLI password (if enabled and readable by the current user)
if [ -r /etc/pihole/cli_pw ]; then
password=$(cat /etc/pihole/cli_pw)

# Try to authenticate using the CLI password
Authenticate
fi

# If this did not work, ask the user for the password
while [ "${validSession}" = false ] || [ -z "${validSession}" ] ; do
moveXOffset; echo "Authentication failed."

Expand Down

0 comments on commit 18e240c

Please sign in to comment.