mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-21 22:38:08 +00:00
Apply suggestions from code review
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
f713b14ba0
commit
9e47b61c8f
@ -38,15 +38,16 @@ start() {
|
||||
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-prestart.sh"
|
||||
|
||||
if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_IPC_LOCK,CAP_CHOWN+eip "/usr/bin/pihole-FTL"; then
|
||||
su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole || ec=$?
|
||||
su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole
|
||||
else
|
||||
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system"
|
||||
/usr/bin/pihole-FTL || ec=$?
|
||||
/usr/bin/pihole-FTL
|
||||
fi
|
||||
rc=$?
|
||||
# Cleanup if startup failed
|
||||
if [ -n "${ec}" ] && [ "${ec}" != 0 ]; then
|
||||
if [ "${rc}" != 0 ]; then
|
||||
cleanup
|
||||
exit $ec
|
||||
exit $rc
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user