Implement public IP check for VPN leak monitoring

Added public IP fetching and logging for VPN services.
This commit is contained in:
Alexandre
2025-11-24 08:50:17 +01:00
committed by GitHub
parent 822c03dac9
commit 0264ef9d97

View File

@@ -230,9 +230,15 @@ _setup_wireguard() {
# --- Main Execution ---
echo "$(_fetch_public_ip || true)" > /currentip
if bashio::config.true 'openvpn_enabled'; then
# Start Leak Monitor
_vpn_monitor_public_ip "OpenVPN" &
if [[ -s /currentip ]]; then
bashio::log.warning "Could not fetch public ip, the vpn leakage service will not run"
else
_vpn_monitor_public_ip "OpenVPN" &
fi
exec /usr/sbin/openvpn \
--config /config/openvpn/config.ovpn \
@@ -251,7 +257,11 @@ elif bashio::config.true 'wireguard_enabled'; then
_setup_wireguard
# Start Leak Monitor
_vpn_monitor_public_ip "WireGuard" &
if [[ -s /currentip ]]; then
bashio::log.warning "Could not fetch public ip, the vpn leakage service will not run"
else
_vpn_monitor_public_ip "WireGuard" &
fi
fi