mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-26 16:00:31 +02:00
Check if VPN services are already running before start
This commit is contained in:
@@ -29,10 +29,18 @@ 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 ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user