mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
29 lines
983 B
Plaintext
29 lines
983 B
Plaintext
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
# ==============================================================================
|
|
|
|
# Wait for transmission to become available
|
|
bashio::net.wait_for 8080 localhost 900
|
|
|
|
if [ -f /currentip ]; then
|
|
if [[ "$(curl -s ipecho.net/plain)" = "$(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
|
|
else
|
|
bashio::log.info "VPN is up and running with ip $(curl -s ipecho.net/plain)"
|
|
fi
|
|
fi
|
|
|
|
if [ -f /currentip2 ]; then
|
|
if [[ "$(curl -s ipecho.net/plain --interface tun0)" = "$(cat /currentip2)" ]]; 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
|
|
else
|
|
bashio::log.info "VPN is up and running with ip $(curl -s ipecho.net/plain --interface tun0)"
|
|
fi
|
|
fi
|
|
|
|
bashio::log.info "Starting NGinx..."
|
|
|
|
exec nginx
|