mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-07-27 15:44:10 +02:00
Do not skip root check for pihole user (#6312)
This commit is contained in:
commit
5b5e02d492
4
pihole
4
pihole
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user