mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Split check for return code and user
Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
@@ -251,9 +251,12 @@ fix_capabilities() {
|
|||||||
|
|
||||||
setcap "${CAP_STR:1}"+ep "$(which pihole-FTL)" || ret=$?
|
setcap "${CAP_STR:1}"+ep "$(which pihole-FTL)" || ret=$?
|
||||||
|
|
||||||
if [[ $ret -ne 0 && "${DNSMASQ_USER:-pihole}" != "root" ]]; then
|
if [[ $ret -ne 0 ]]; then
|
||||||
echo " [!] ERROR: Unable to set capabilities for pihole-FTL. Cannot run as non-root."
|
echo " [!] ERROR: Unable to set capabilities for pihole-FTL. "
|
||||||
echo " If you are seeing this error, please set the environment variable 'DNSMASQ_USER' to the value 'root'"
|
if [[ "${DNSMASQ_USER:-pihole}" != "root" ]]; then
|
||||||
|
echo " Cannot run as non-root."
|
||||||
|
echo " If you are seeing this error, please set the environment variable 'DNSMASQ_USER' to the value 'root'"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user