From d6a83baf4fc9f2fcc4ea1649dd3c6844ef20bf93 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 14 Jul 2025 21:38:59 +0100 Subject: [PATCH 1/2] Allow non-root access for updateGravity command Signed-off-by: Adam Warner --- pihole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pihole b/pihole index c1566ed7..ba4fa19d 100755 --- a/pihole +++ b/pihole @@ -552,7 +552,7 @@ case "${1}" in "enable" ) need_root=0;; "disable" ) need_root=0;; "-d" | "debug" ) ;; - "-g" | "updateGravity" ) ;; + "-g" | "updateGravity" ) need_root=0;; "reloaddns" ) ;; "reloadlists" ) ;; "setpassword" ) ;; From 1bef0415dbb76c0db6e4ec1dd324392cac230077 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 14 Jul 2025 22:02:02 +0100 Subject: [PATCH 2/2] bare minimum first past fix for `pihoe api` command not working due to attempting to re-set readony variabes PI_HOE_SCRIPT_DIR and utisfie. Can't compain about them being readony if they're.. not. Signed-off-by: Adam Warner --- pihole | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pihole b/pihole index c1566ed7..9688e9e9 100755 --- a/pihole +++ b/pihole @@ -9,7 +9,7 @@ # This file is copyright under the latest version of the EUPL. # Please see LICENSE file for your rights under this license. -readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" +PI_HOLE_SCRIPT_DIR="/opt/pihole" # PI_HOLE_BIN_DIR is not readonly here because in some functions (checkout), # they might get set again when the installer is sourced. This causes an @@ -20,7 +20,7 @@ readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE" # shellcheck source=./advanced/Scripts/COL_TABLE source "${colfile}" -readonly utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" +utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" # shellcheck source=./advanced/Scripts/utils.sh source "${utilsfile}"