mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 21:04:05 +02:00
fix vpn check script logic
This commit is contained in:
@@ -144,14 +144,17 @@ if [[ "${vpn_openvpn}" == true && "${vpn_wireguard}" == true ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${vpn_openvpn}" == true ]] && ! bashio::config.true 'openvpn_alt_mode'; then
|
if [[ "${vpn_openvpn}" == true ]]; then
|
||||||
VPN_INTERFACE=$(cat "/var/run/openvpn/interface")
|
VPN_INTERFACE=$(cat "/var/run/openvpn/interface")
|
||||||
bashio::log.info "VPN monitor set to query external IP through interface ${VPN_INTERFACE} (interface binding)."
|
bashio::log.info "VPN monitor set to query external IP through interface ${VPN_INTERFACE} (interface binding)."
|
||||||
elif [[ "${vpn_wireguard}" == true ]]; then
|
elif [[ "${vpn_wireguard}" == true ]]; then
|
||||||
VPN_INTERFACE=$(cat "/var/run/wireguard/interface")
|
VPN_INTERFACE=$(cat "/var/run/wireguard/interface")
|
||||||
bashio::log.info "VPN monitor set to query external IP through interface ${VPN_INTERFACE} (interface binding)."
|
bashio::log.info "VPN monitor set to query external IP through interface ${VPN_INTERFACE} (interface binding)."
|
||||||
else
|
fi
|
||||||
VPN_INTERFACE=""
|
if [[ -z "${VPN_INTERFACE}" ]] || ! ip link show "${VPN_INTERFACE}" > /dev/null 2>&1 ; then
|
||||||
|
bashio::log.error "VPN interface not found."
|
||||||
|
bashio::addon.stop
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REAL_IP="$(read_real_ip)"
|
REAL_IP="$(read_real_ip)"
|
||||||
|
|||||||
Reference in New Issue
Block a user