From 2a712cc9c1eb91d0bdd54192067d0c4117cf7db5 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 27 Apr 2022 11:07:24 +0200 Subject: [PATCH] Silent mode https://github.com/alexbelgium/hassio-addons/issues/281 --- .../rootfs/etc/services.d/qbittorrent/run | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/qbittorrent/rootfs/etc/services.d/qbittorrent/run b/qbittorrent/rootfs/etc/services.d/qbittorrent/run index 8a8780ce1..d7a80cb7a 100644 --- a/qbittorrent/rootfs/etc/services.d/qbittorrent/run +++ b/qbittorrent/rootfs/etc/services.d/qbittorrent/run @@ -3,8 +3,20 @@ WEBUI_PORT=${WEBUI_PORT:-8080} -if bashio::config.true 'openvpn_enabled'; then - exec /usr/sbin/openvpn --config /etc/openvpn/config.ovpn --script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh -else - exec s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" +if bashio::config.true 'silent'; then + sed -i 's|/proc/1/fd/1 hassio;|off;|g' /etc/nginx/nginx.conf +fi + +if bashio::config.true 'openvpn_enabled'; then + if bashio::config.true 'silent'; then + exec /usr/sbin/openvpn --config /etc/openvpn/config.ovpn --script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh >/dev/null + else + exec /usr/sbin/openvpn --config /etc/openvpn/config.ovpn --script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh + fi +else + if bashio::config.true 'silent'; then + exec s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" >/dev/null + else + exec s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" + fi fi