Exit with return code if ftl does not start

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2022-08-04 17:20:39 -07:00
parent 4a589286b7
commit 989c52ef24
No known key found for this signature in database
GPG key ID: 6055EE2AD4004FC0

View file

@ -58,10 +58,10 @@ start() {
fi
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
su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole || exit $?
else
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system"
/usr/bin/pihole-FTL
/usr/bin/pihole-FTL || exit $?
fi
echo
fi