mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 22:00:17 +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
1 changed files with 5 additions and 4 deletions
|
@ -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 a new issue