1
0
mirror of https://github.com/pi-hole/pi-hole.git synced 2025-09-15 13:21:15 +08:00

Do not skip root check for pihole user (#6312)

This commit is contained in:
Dan Schaper
2025-07-10 11:48:29 -07:00
committed by GitHub

4
pihole
View File

@ -570,9 +570,9 @@ if [[ -z ${USER} ]]; then
USER=$(whoami)
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.
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 " ${COL_GREEN}sudo pihole $*${COL_NC}"
exit 1