jacklul
Senior Member
You could try modifying /opt/bin/pihole by inserting debug info in those specific lines:
And retrying from the web UI and posting the output.
For me this outputs pihole user correctly.
Code:
# In the case of alpine running in a container, the USER variable appears to be blank
# which prevents the next trap from working correctly. Set it by running whoami
if [[ -z ${USER} ]]; then
USER=$(whoami)
fi
echo "USER = $USER"
echo "EUID = $EUID"
echo "UID = $UID"
echo "SHELL = $SHELL"
echo "PWD = $PWD"
echo "HOME = $HOME"
echo "PPID = $PPID"
# Check if the current user is not root and if the command
# requires root. If so, exit with an error message.
# Add an exception for the user "pihole" to allow the webserver running gravity
if [[ ( $EUID -ne 0 && ${USER} != "pihole" ) && -n "${need_root}" ]]; then
echo -e " ${CROSS} This Pi-hole command requires root privileges, try:"
echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}"
exit 1
fi
And retrying from the web UI and posting the output.
For me this outputs pihole user correctly.
Last edited:
