mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-21 17:23:59 +02:00
Simplify VPN checks and streamline qBittorrent startup
This commit is contained in:
@@ -29,18 +29,10 @@ if [[ "${openvpn_enabled}" == true && "${wireguard_enabled}" == true ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${openvpn_enabled}" == true ]]; then
|
if [[ "${openvpn_enabled}" == true ]]; then
|
||||||
if pgrep -x openvpn > /dev/null 2>&1; then
|
|
||||||
bashio::log.info "OpenVPN is already running, skipping startup."
|
|
||||||
else
|
|
||||||
/usr/local/sbin/vpn openvpn up
|
/usr/local/sbin/vpn openvpn up
|
||||||
fi
|
|
||||||
elif [[ "${wireguard_enabled}" == true ]]; then
|
elif [[ "${wireguard_enabled}" == true ]]; then
|
||||||
if pgrep -x wg > /dev/null 2>&1 || ip link show wg0 > /dev/null 2>&1; then
|
|
||||||
bashio::log.info "WireGuard is already running, skipping startup."
|
|
||||||
else
|
|
||||||
/usr/local/sbin/vpn wireguard up
|
/usr/local/sbin/vpn wireguard up
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Launch qBittorrent ---
|
# --- Launch qBittorrent ---
|
||||||
|
|
||||||
@@ -52,10 +44,6 @@ fi
|
|||||||
|
|
||||||
bashio::log.info "Starting qBittorrent..."
|
bashio::log.info "Starting qBittorrent..."
|
||||||
|
|
||||||
if [ -f /etc/s6-overlay/s6-rc.d/svc-qbittorrent/notification-fd ]; then
|
|
||||||
exec \
|
exec \
|
||||||
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
|
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
|
||||||
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
|
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
|
||||||
else
|
|
||||||
exec s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user