mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-03 22:34:11 +02:00
Update 99-run.sh
This commit is contained in:
@@ -20,37 +20,39 @@ fi
|
|||||||
# NGINX SETTING #
|
# NGINX SETTING #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
#declare port
|
if [[ "$INGRESS" == "true" ]]; then
|
||||||
#declare certfile
|
#declare port
|
||||||
declare ingress_interface
|
#declare certfile
|
||||||
declare ingress_port
|
declare ingress_interface
|
||||||
#declare keyfile
|
declare ingress_port
|
||||||
|
#declare keyfile
|
||||||
FB_BASEURL="$(bashio::addon.ingress_entry)"
|
|
||||||
export FB_BASEURL
|
FB_BASEURL="$(bashio::addon.ingress_entry)"
|
||||||
|
export FB_BASEURL
|
||||||
declare ADDON_PROTOCOL=http
|
|
||||||
# Generate Ingress configuration
|
declare ADDON_PROTOCOL=http
|
||||||
if bashio::config.true 'ssl'; then
|
# Generate Ingress configuration
|
||||||
ADDON_PROTOCOL=https
|
if bashio::config.true 'ssl'; then
|
||||||
fi
|
ADDON_PROTOCOL=https
|
||||||
|
|
||||||
#port=$(bashio::addon.port 80)
|
|
||||||
ingress_port=$(bashio::addon.ingress_port)
|
|
||||||
ingress_interface=$(bashio::addon.ip_address)
|
|
||||||
sed -i "s|%%protocol%%|${ADDON_PROTOCOL}|g" /etc/nginx/servers/ingress.conf
|
|
||||||
sed -i "s|%%port%%|${ingress_port}|g" /etc/nginx/servers/ingress.conf
|
|
||||||
sed -i "s|%%interface%%|${ingress_interface}|g" /etc/nginx/servers/ingress.conf
|
|
||||||
sed -i "s|%%subpath%%|${FB_BASEURL}/|g" /etc/nginx/servers/ingress.conf
|
|
||||||
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
|
||||||
|
|
||||||
# Correct baseurl
|
|
||||||
for file in /config/hypercorn.toml $(find /usr -name hypercorn.toml.default); do
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
sed -i "/root_path/d" "$file"
|
|
||||||
sed -i "1a root_path = \"${FB_BASEURL}\"" "$file"
|
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
#port=$(bashio::addon.port 80)
|
||||||
|
ingress_port=$(bashio::addon.ingress_port)
|
||||||
|
ingress_interface=$(bashio::addon.ip_address)
|
||||||
|
sed -i "s|%%protocol%%|${ADDON_PROTOCOL}|g" /etc/nginx/servers/ingress.conf
|
||||||
|
sed -i "s|%%port%%|${ingress_port}|g" /etc/nginx/servers/ingress.conf
|
||||||
|
sed -i "s|%%interface%%|${ingress_interface}|g" /etc/nginx/servers/ingress.conf
|
||||||
|
sed -i "s|%%subpath%%|${FB_BASEURL}/|g" /etc/nginx/servers/ingress.conf
|
||||||
|
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
||||||
|
|
||||||
|
# Correct baseurl
|
||||||
|
for file in /config/hypercorn.toml $(find /usr -name hypercorn.toml.default); do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
sed -i "/root_path/d" "$file"
|
||||||
|
sed -i "1a root_path = \"${FB_BASEURL}\"" "$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# LAUNCH APP #
|
# LAUNCH APP #
|
||||||
@@ -63,8 +65,9 @@ bashio::log.warning "Username: comixedreader@localhost Password: comixedreader"
|
|||||||
bashio::log.info "Starting..."
|
bashio::log.info "Starting..."
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
/./app/comixed-release*/bin/run.sh -L /config/comixed.log & true
|
/./app/comixed-release*/bin/run.sh -L /config/comixed.log
|
||||||
|
|
||||||
bashio::net.wait_for 7171 localhost 900 || true
|
#& true
|
||||||
bashio::log.info "Started !"
|
#bashio::net.wait_for 7171 localhost 900 || true
|
||||||
exec nginx
|
#bashio::log.info "Started !"
|
||||||
|
#exec nginx
|
||||||
|
|||||||
Reference in New Issue
Block a user