1From a2b3aa45d6e073272608506b1d27e4f43f2b0032 Mon Sep 17 00:00:00 2001
2From: williamvds <william@williamvds.me>
3Date: Sun, 6 Apr 2025 23:00:41 +0100
4Subject: [PATCH 1/3] Remove sudo
5
6Rely on polkit and sensible permissions
7---
8 pihole | 8 --------
9 1 file changed, 8 deletions(-)
10
11diff --git a/pihole b/pihole
12index 1d5093c..6afc48a 100755
13--- a/pihole
14+++ b/pihole
15@@ -570,14 +570,6 @@ if [[ -z ${USER} ]]; then
16 USER=$(whoami)
17 fi
18
19-# Check if the current user is neither root nor pihole and if the command
20-# requires root. If so, exit with an error message.
21-if [[ $EUID -ne 0 && ${USER} != "pihole" && need_root -eq 1 ]];then
22- echo -e " ${CROSS} The Pi-hole command requires root privileges, try:"
23- echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}"
24- exit 1
25-fi
26-
27 # Handle redirecting to specific functions based on arguments
28 case "${1}" in
29 "allow" | "allowlist" ) listFunc "$@";;
30--
312.48.1
32