Test manual_override

This commit is contained in:
Alexandre
2021-10-15 18:13:48 +02:00
committed by GitHub
parent ef3b8dad56
commit 7b3f787b7d

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bashio
bashio::log.info "Starting Portainer..."
##################
# DEFINE OPTIONS #
##################
@@ -9,7 +11,21 @@ options+=(--bind 0.0.0.0:9000)
#options+=(--templates /opt/portainer/templates.json)
options+=(--host unix:///var/run/docker.sock)
bashio::log.info "Starting Portainer..."
###################
# MANUAL OVERRIDE #
###################
if bashio::fs.file_exists "/data/manual_override" && bashio::config.true 'manual_override' ; then
bashio::log.warning '... "manual_override" option is checked, portainer launched in manual override mode with no configuration'
exec /opt/portainer/portainer "${options[@]}"
elseif ! bashio::fs.file_exists "/data/manual_override" && bashio::config.true 'manual_override' ; then
rm /data/portainer.db || true
touch "/data/manual_override"
bashio::log.warning '... "manual_override" option is checked, previous configuration removed, portainer launched in manual override mode with no configuration'
exec /opt/portainer/portainer "${options[@]}"
elseif bashio::fs.file_exists "/data/manual_override" && ! bashio::config.true 'manual_override' ; then
rm /data/manual_override
fi
################
# SET PASSWORD #
@@ -49,13 +65,13 @@ if bashio::config.true 'ssl'; then
options+=(--sslcert /ssl/$CERTFILE)
options+=(--sslkey /ssl/$KEYFILE)
bashio::log.info "... ssl activated"
fi
fi
###################
# HIDE CONTAINERS #
###################
# Hide Hassio containers by default, but only eforce on first run
# Hide Hassio containers by default, but only enforce on first run
if ! bashio::fs.file_exists "/data/hidden"; then
options+=(--hide-label io.hass.type=supervisor)
options+=(--hide-label io.hass.type=homeassistant)