mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-30 11:16:06 +02:00
Test manual_override
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bashio
|
#!/usr/bin/env bashio
|
||||||
|
|
||||||
|
bashio::log.info "Starting Portainer..."
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# DEFINE OPTIONS #
|
# DEFINE OPTIONS #
|
||||||
##################
|
##################
|
||||||
@@ -9,7 +11,21 @@ options+=(--bind 0.0.0.0:9000)
|
|||||||
#options+=(--templates /opt/portainer/templates.json)
|
#options+=(--templates /opt/portainer/templates.json)
|
||||||
options+=(--host unix:///var/run/docker.sock)
|
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 #
|
# SET PASSWORD #
|
||||||
@@ -49,13 +65,13 @@ if bashio::config.true 'ssl'; then
|
|||||||
options+=(--sslcert /ssl/$CERTFILE)
|
options+=(--sslcert /ssl/$CERTFILE)
|
||||||
options+=(--sslkey /ssl/$KEYFILE)
|
options+=(--sslkey /ssl/$KEYFILE)
|
||||||
bashio::log.info "... ssl activated"
|
bashio::log.info "... ssl activated"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# HIDE CONTAINERS #
|
# 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
|
if ! bashio::fs.file_exists "/data/hidden"; then
|
||||||
options+=(--hide-label io.hass.type=supervisor)
|
options+=(--hide-label io.hass.type=supervisor)
|
||||||
options+=(--hide-label io.hass.type=homeassistant)
|
options+=(--hide-label io.hass.type=homeassistant)
|
||||||
|
|||||||
Reference in New Issue
Block a user