File disable-sudo-need.patch of Package pi-hole
Index: pi-hole-5.17.3/pihole
===================================================================
--- pi-hole-5.17.3.orig/pihole
+++ pi-hole-5.17.3/pihole
@@ -550,17 +550,6 @@ case "${1}" in
* ) helpFunc;;
esac
-# Must be root to use this tool
-if [[ ! $EUID -eq 0 ]];then
- if [[ -x "$(command -v sudo)" ]]; then
- exec sudo bash "$0" "$@"
- exit $?
- else
- echo -e " ${CROSS} sudo is needed to run pihole commands. Please run this script as root or install sudo."
- exit 1
- fi
-fi
-
# Handle redirecting to specific functions based on arguments
case "${1}" in
"-w" | "whitelist" ) listFunc "$@";;
Index: pi-hole-5.17.3/advanced/Scripts/piholeLogFlush.sh
===================================================================
--- pi-hole-5.17.3.orig/advanced/Scripts/piholeLogFlush.sh
+++ pi-hole-5.17.3/advanced/Scripts/piholeLogFlush.sh
@@ -74,7 +74,7 @@ if [[ "$@" == *"force"* ]]; then
deleted=$(pihole-FTL sqlite3 -ni "${DBFILE}" "DELETE FROM query_storage WHERE timestamp >= strftime('%s','now')-86400; select changes() from query_storage limit 1")
# Restart pihole-FTL to force reloading history
- sudo pihole restartdns
+ pihole restartdns
fi
if [[ "$@" != *"quiet"* ]]; then