mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
Revert
This commit is contained in:
@@ -8,15 +8,20 @@ bashio::net.wait_for 8080 localhost 900
|
||||
|
||||
bashio::log.info "Starting NGinx..."
|
||||
|
||||
if [[ "$(bashio::config 'VPN_ENABLED')" == "yes" ]]; then
|
||||
# Check vpn is working
|
||||
if [ -f /currentip ]; then
|
||||
exec nginx & \
|
||||
while true; do
|
||||
# Get vpn ip
|
||||
curl -s ipecho.net/plain --interface tun0 > /vpnip
|
||||
if bashio::config.true 'openvpn_alt_mode'; then
|
||||
curl -s ipecho.net/plain > /vpnip
|
||||
else
|
||||
curl -s ipecho.net/plain --interface tun0 > /vpnip
|
||||
fi
|
||||
|
||||
# Verify ip has changed
|
||||
if [[ "$(cat /vpnip)" = "$(cat /currentip)" ]]; then
|
||||
bashio::log.fatal "VPN is not properly configured. Your ip is exposed."
|
||||
bashio::log.fatal "VPN is not properly configured. Your ip is exposed. Please fix this, or do not use the vpn alt mode"
|
||||
bashio::exit.nok
|
||||
fi
|
||||
|
||||
@@ -27,7 +32,7 @@ if [[ "$(bashio::config 'VPN_ENABLED')" == "yes" ]]; then
|
||||
bashio::log.info "VPN is up and running with ip $(cat /vpnip), based in country : $COUNTRY"
|
||||
|
||||
# Check every 15m
|
||||
sleep 30m
|
||||
sleep 15m
|
||||
|
||||
true
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user