Rollback code to 2.17.1-2

https://github.com/alexbelgium/hassio-addons/issues/745
This commit is contained in:
Alexandre
2023-03-08 13:44:07 +01:00
parent 1fdb5b9fb1
commit 6d735ad084
24 changed files with 71 additions and 90 deletions

View File

@@ -0,0 +1,23 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
if [ -e "/PORTFILE" ]; then
echo "Installing portainer..."
BUILD_UPSTREAM=$(</PORTFILE)
BUILD_ARCH=$(uname -m)
echo "${BUILD_ARCH}"
BUILD_ARCH=${BUILD_ARCH:-x86}
if [[ "${BUILD_ARCH}" == *aarch64* ]]; then ARCH="arm64"; fi
if [[ "${BUILD_ARCH}" == *armv8* ]]; then ARCH="arm64"; fi
if [[ "${BUILD_ARCH}" == *arm64* ]]; then ARCH="arm64"; fi
if [[ "${BUILD_ARCH}" == *armhf* ]]; then ARCH="arm"; fi
if [[ "${BUILD_ARCH}" == *armv7* ]]; then ARCH="arm"; fi
if [[ "${BUILD_ARCH}" == arm ]]; then ARCH="arm"; fi
if [[ "${BUILD_ARCH}" == *x86* ]]; then ARCH="amd64"; fi
curl -f -L -s -S \
"https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" |
tar zxvf - -C /opt/ >/dev/null
echo "... success!"
fi

View File

@@ -1,4 +1,4 @@
#!/command/with-contenv bashio
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
#################
@@ -30,5 +30,3 @@ bashio::var.json \
tempio \
-template /etc/nginx/templates/ingress.gtpl \
-out /etc/nginx/servers/ingress.conf
bashio::require.unprotected

View File

@@ -0,0 +1,7 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Portainer
# Runs some initializations for Portainer
# ==============================================================================
bashio::require.unprotected

View File

@@ -1 +0,0 @@
oneshot

View File

@@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-nginx/run

View File

@@ -1,26 +0,0 @@
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: AdGuard Home
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="NGINX"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi

View File

@@ -1,11 +0,0 @@
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: AdGuard Home
# Runs the Nginx daemon
# ==============================================================================
# Wait for adguard to become available
bashio::net.wait_for 9000 localhost 900
bashio::log.info "Starting NGinx..."
exec nginx

View File

@@ -1 +0,0 @@
longrun

View File

@@ -1,27 +0,0 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: AdGuard Home
# Take down the S6 supervision tree when Adguard Home fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="Adguard Home"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi

View File

@@ -1 +0,0 @@
longrun

View File

@@ -0,0 +1,9 @@
#!/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,12 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
bashio::log.info "Waiting for port 9000 to open..."
# Wait for transmission to become available
bashio::net.wait_for 9000 localhost 900
bashio::log.info "Starting NGinx..."
exec nginx

View File

@@ -0,0 +1,9 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: Portainer
# Take down the S6 supervision tree when Portainer fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -1,4 +1,4 @@
#!/command/with-contenv bashio
#!/usr/bin/env bashio
# shellcheck shell=bash
bashio::log.info "Starting Portainer..."