mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Implement public IP check for VPN leak monitoring
Added public IP fetching and logging for VPN services.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user