Added startup script to kill sinker and hl_client in self-hosted mode (#339)

These two processes do nothing in self-hosted mode and is now removed
from the init startup script.
This commit is contained in:
Leo 2022-10-13 01:34:01 -06:00 committed by GitHub
parent b35653f86f
commit 2388a135ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,30 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Short-Description: Kills unwanted processes in selfhosted mode (sinker and hl_client)
# Description: sinker and hl_client phones home. In self-hosted mode, these two processes can be killed to save CPU cycles (and reduce log spam).
### END INIT INFO
. /opt/wz_mini/wz_mini.conf
case "$1" in
start)
echo "#####$(basename "$0")#####"
# If not enabled, quit
if [[ "$ENABLE_SELFHOSTED_MODE" != "true" ]] ; then
exit 0
fi
# Remove sinker/hl_client lines from the startup script
sed -i '/sinker/d' /opt/wz_mini/tmp/.storage/app_init.sh
sed -i '/hl_client/d' /opt/wz_mini/tmp/.storage/app_init.sh
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac