diff --git a/openvpn/start.sh b/openvpn/start.sh index 67513f5..5020edf 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -267,7 +267,9 @@ if [[ $VPN_ENABLED == "yes" ]]; then else echo "[INFO] Starting WireGuard..." | ts '%Y-%m-%d %H:%M:%.S' cd /config/wireguard - wg-quick down $VPN_CONFIG || echo "WireGuard is down already" | ts '%Y-%m-%d %H:%M:%.S' # Run wg-quick down as an extra safeguard in case WireGuard is still up for some reason + if ip link | grep -q `basename -s .conf $VPN_CONFIG`; then + wg-quick down $VPN_CONFIG || echo "WireGuard is down already" | ts '%Y-%m-%d %H:%M:%.S' # Run wg-quick down as an extra safeguard in case WireGuard is still up for some reason + fi sleep 0.5 # Just to give WireGuard a bit to go down wg-quick up $VPN_CONFIG #exec /bin/bash /etc/openvpn/openvpn.init start &