Update run

This commit is contained in:
Alexandre
2022-07-04 11:07:10 +02:00
committed by GitHub
parent 3c4af4a75c
commit d911b9ba46

View File

@@ -5,9 +5,12 @@
# Wait for transmission to become available
bashio::net.wait_for 8080 localhost 900
bashio::log.info "Starting NGinx..."
# Check vpn is working
if [ -f /currentip ]; then
exec nginx & \
while true; do
# Get vpn ip
if bashio::config.true 'openvpn_alt_mode'; then
curl -s ipecho.net/plain > /vpnip
@@ -27,27 +30,9 @@ if [ -f /currentip ]; then
# Inform by message
bashio::log.info "VPN is up and running with ip $(cat /vpnip), based in country : $COUNTRY"
fi
bashio::log.info "Starting NGinx..."
# Check vpn is working
if [ -f /currentip ]; then
exec nginx & \
while true; do
# Check every 15m
sleep 15m
# Get vpn ip
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. Please fix this, or do not use the vpn alt mode"
bashio::exit.nok
fi
true
done
else