From fc354c0c09071a9d51b6413ece0400b43f1c9d62 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Sun, 16 Feb 2025 08:58:38 +0100 Subject: [PATCH] Add hint to skip 2FA in case the app password was used Signed-off-by: yubiuser --- padd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/padd.sh b/padd.sh index 18f5f1b..329e597 100755 --- a/padd.sh +++ b/padd.sh @@ -194,7 +194,7 @@ LoginAPI() { # 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) - # If we can read the CLI password, we can skip 2FA even when it's required + # If we can read the CLI password, we can skip 2FA even when it's required otherwise needTOTP=false fi @@ -207,7 +207,8 @@ LoginAPI() { if [ "${needTOTP}" = true ] && [ -z "${totp}" ]; then # 2FA required, but no TOTP was supplied as argument - moveXOffset; echo "Please enter the correct second factor:" + moveXOffset; echo "Please enter the correct second factor." + moveXOffset; echo "(Can be any number if you used the app password)" moveXOffset; read -r totp fi @@ -234,6 +235,7 @@ LoginAPI() { if [ "${needTOTP}" = true ]; then moveXOffset; echo "Please enter the correct second factor:" + moveXOffset; echo "(Can be any number if you used the app password)" moveXOffset; read -r totp fi