diff --git a/advanced/Templates/pihole-FTL.service b/advanced/Templates/pihole-FTL.service index dc7649e7..460339ae 100644 --- a/advanced/Templates/pihole-FTL.service +++ b/advanced/Templates/pihole-FTL.service @@ -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