|
|
@ -38,15 +38,16 @@ start() {
|
|
|
|
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-prestart.sh"
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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 || ec=$?
|
|
|
|
/usr/bin/pihole-FTL
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rc=$?
|
|
|
|
# Cleanup if startup failed
|
|
|
|
# Cleanup if startup failed
|
|
|
|
if [ -n "${ec}" ] && [ "${ec}" != 0 ]; then
|
|
|
|
if [ "${rc}" != 0 ]; then
|
|
|
|
cleanup
|
|
|
|
cleanup
|
|
|
|
exit $ec
|
|
|
|
exit $rc
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|