]> git.feebdaed.xyz Git - 0xmirror/pi-hole.git/commitdiff
Revert https://github.com/pi-hole/pi-hole/pull/6312
authorChristian König <github@yubiuser.dev>
Wed, 16 Jul 2025 11:50:37 +0000 (13:50 +0200)
committerChristian König <github@yubiuser.dev>
Wed, 16 Jul 2025 11:50:37 +0000 (13:50 +0200)
Signed-off-by: Christian König <github@yubiuser.dev>
pihole

diff --git a/pihole b/pihole
index 7b5e3eb83af8cb5dd82028a257f0d6abb7b1b80d..1231e993af39ae0a9b4796d4357c3a25d1b12e69 100755 (executable)
--- a/pihole
+++ b/pihole
@@ -572,7 +572,8 @@ fi
 
 # Check if the current user is not root and if the command
 # requires root. If so, exit with an error message.
-if [[ $EUID -ne 0 && need_root -eq 1 ]];then
+# Add an exception for the user "pihole" to allow the webserver running gravity
+if [[ $EUID -ne 0 && ${USER} != "pihole" && need_root -eq 1 ]];then
   echo -e "  ${CROSS} The Pi-hole command requires root privileges, try:"
   echo -e "      ${COL_GREEN}sudo pihole $*${COL_NC}"
   exit 1