mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-30 12:24:04 +02:00
Rollback code to 2.17.1-2
https://github.com/alexbelgium/hassio-addons/issues/745
This commit is contained in:
23
portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh
Normal file
23
portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh
Normal 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
|
||||
4
portainer/rootfs/etc/s6-overlay/s6-rc.d/init-nginx/run → portainer/rootfs/etc/cont-init.d/30-nginx.sh
Executable file → Normal file
4
portainer/rootfs/etc/s6-overlay/s6-rc.d/init-nginx/run → portainer/rootfs/etc/cont-init.d/30-nginx.sh
Executable file → Normal 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
|
||||
7
portainer/rootfs/etc/cont-init.d/portainer.sh
Normal file
7
portainer/rootfs/etc/cont-init.d/portainer.sh
Normal 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
|
||||
@@ -1 +0,0 @@
|
||||
oneshot
|
||||
@@ -1 +0,0 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-nginx/run
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
longrun
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
longrun
|
||||
9
portainer/rootfs/etc/services.d/nginx/finish
Normal file
9
portainer/rootfs/etc/services.d/nginx/finish
Normal 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
|
||||
12
portainer/rootfs/etc/services.d/nginx/run
Normal file
12
portainer/rootfs/etc/services.d/nginx/run
Normal 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
|
||||
9
portainer/rootfs/etc/services.d/portainer/finish
Normal file
9
portainer/rootfs/etc/services.d/portainer/finish
Normal 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
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bashio
|
||||
#!/usr/bin/env bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
bashio::log.info "Starting Portainer..."
|
||||
Reference in New Issue
Block a user