Add ingress

This commit is contained in:
Alexandre
2023-02-04 12:32:32 +01:00
parent 043335cda9
commit 3fe3e23e07
17 changed files with 364 additions and 7 deletions

View File

@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Wait for transmission to become available
bashio::net.wait_for 8787 localhost 900
# Set base url
CONFIG_LOCATION=/config/addons_config/readarr/config.xml
if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$(bashio::config 'CONFIG_LOCATION')"
# Modify if it is a base directory
if [ -f "$CONFIG_LOCATION" ]; then CONFIG_LOCATION="$(dirname $CONFIG_LOCATION)"; fi
fi
while ! [ -f "$CONFIG_LOCATION" ];
do
echo "Waiting for $CONFIG_LOCATION to be created"
sleep 1
done
if ! grep -q "<UrlBase>/readarr</UrlBase>" "$CONFIG_LOCATION"; then
bashio::log.warning "BaseUrl not set properly, restarting"
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/readarr<\/UrlBase>" "$CONFIG_LOCATION"
bashio::addon.restart
fi
bashio::log.info "Starting NGinx..."
exec nginx