mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-31 09:13:33 +02:00
bashio now emits deprecation warnings for bashio::addon.* calls. This migrates all 227 call-sites across 86 files to use the new bashio::app.* API. Cross-compatibility is preserved in two ways: 1. bashio-standalone.sh: adds bashio::app.* functions that forward to bashio::addon.* (used when running without HA Supervisor). Also adds the missing ingress_url, restart and stop stubs. 2. ha_entrypoint.sh: injects a one-liner compat shim after the shebang of every cont-init and service script at container startup. On old bashio installations (bashio::app.* absent) the shim defines bashio::app.* as thin wrappers around bashio::addon.*; on new bashio the guard condition is true so the block is a no-op. The probe script in ha_entrypoint.sh is also updated to try bashio::app.version before falling back to bashio::addon.version. https://claude.ai/code/session_011FWFBhYQ6VS5FauSqv4UMo
31 lines
979 B
Plaintext
Executable File
31 lines
979 B
Plaintext
Executable File
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
set -e
|
|
# ==============================================================================
|
|
|
|
# Set variables
|
|
slug=radarr
|
|
port=7878
|
|
CONFIG_LOCATION=/config/config.xml
|
|
|
|
# Wait for transmission to become available
|
|
bashio::net.wait_for "$port" localhost 900
|
|
|
|
if bashio::config.has_value 'CONFIG_LOCATION'; then
|
|
CONFIG_LOCATION="$(bashio::config 'CONFIG_LOCATION')"
|
|
# Modify if it is a base directory
|
|
if [[ "$CONFIG_LOCATION" == *.* ]]; then CONFIG_LOCATION="$(dirname $CONFIG_LOCATION)"; fi
|
|
CONFIG_LOCATION="$CONFIG_LOCATION"/config.xml
|
|
fi
|
|
|
|
# Set UrlBase
|
|
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"
|
|
bashio::app.restart
|
|
fi
|
|
|
|
bashio::log.info "Starting NGinx..."
|
|
exec nginx
|