birdnet-pipy: disable nginx service when ingress is unavailable

This commit is contained in:
Alexandre
2026-02-15 08:33:14 +01:00
parent 570453fd4c
commit 27a64fd80b
5 changed files with 17 additions and 6 deletions

View File

@@ -14,10 +14,13 @@ ingress_interface="$(bashio::addon.ip_address)"
ingress_entry="$(bashio::addon.ingress_entry)"
if ! [[ "${ingress_port}" =~ ^[0-9]+$ ]] || [[ "${ingress_port}" -le 0 ]]; then
bashio::log.info "Ingress not active, skipping ingress nginx configuration"
bashio::log.info "Ingress not active, disabling nginx service"
touch /run/nginx-disabled
exit 0
fi
rm -f /run/nginx-disabled
sed -i \
-e "s|proxy_pass http://api|proxy_pass http://127.0.0.1|g" \
-e "s|proxy_pass http://icecast|proxy_pass http://127.0.0.1|g" \
@@ -31,6 +34,3 @@ sed -i \
/etc/nginx/servers/ingress.conf
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/includes/ingress_params.conf
# Set DNS resolver for internal requests
sed -i "s/%%dns_host%%/127.0.0.11/g" /etc/nginx/includes/resolver.conf