Do not skipp root check for pihole user

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König 2025-06-21 22:40:43 +02:00
parent 1dbe425146
commit 830c4bc049
No known key found for this signature in database

4
pihole
View File

@ -570,9 +570,9 @@ if [[ -z ${USER} ]]; then
USER=$(whoami) USER=$(whoami)
fi fi
# Check if the current user is neither root nor pihole and if the command # Check if the current user is not root and if the command
# requires root. If so, exit with an error message. # requires root. If so, exit with an error message.
if [[ $EUID -ne 0 && ${USER} != "pihole" && need_root -eq 1 ]];then if [[ $EUID -ne 0 && need_root -eq 1 ]];then
echo -e " ${CROSS} The Pi-hole command requires root privileges, try:" echo -e " ${CROSS} The Pi-hole command requires root privileges, try:"
echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}" echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}"
exit 1 exit 1