Merge pull request #4857 from pi-hole/4856-init-script-ftl

Exit init script with error result code if FTL fails to start
This commit is contained in:
Dan Schaper 2022-08-06 13:15:10 -07:00 committed by GitHub
commit 20c561c83c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,10 +58,10 @@ start() {
fi 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 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 else
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system" 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 fi
echo echo
fi fi