This commit is contained in:
Alexandre
2023-11-21 09:53:56 +01:00
parent 2e6e4693a7
commit 8e035dde96
350 changed files with 1908 additions and 1328 deletions

View File

@@ -19,24 +19,12 @@ if bashio::config.has_value 'CONFIG_LOCATION'; then
fi
# Set UrlBase
if ! grep -q "<UrlBase>/$slug</UrlBase>" "$CONFIG_LOCATION" && ! bashio::config.true "ingress_disabled"; then
if ! grep -q "<UrlBase>$slug</UrlBase>" "$CONFIG_LOCATION" && ! bashio::config.true "ingress_disabled"; then
bashio::log.warning "BaseUrl not set properly, restarting"
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/$slug<\/UrlBase>" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>$slug<\/UrlBase>" "$CONFIG_LOCATION"
bashio::addon.restart
fi
# Disable Ingress
if bashio::config.true "ingress_disabled"; then
bashio::log.info "Ingress is disabled, removing base url"
# Remove BaseUrl
if grep -q "$slug" "$CONFIG_LOCATION"; then
bashio::log.warning "BaseUrl removed, restarting"
sed -i "/$slug/d" "$CONFIG_LOCATION"
bashio::addon.restart
fi
fi
bashio::log.info "Starting NGinx..."
exec nginx