From e8f38cf4808bb7120aba4bc362b3e6689b54d181 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 25 Feb 2020 12:39:32 +0100 Subject: [PATCH] :hammer: Improve Portainer service script --- portainer/rootfs/etc/services.d/portainer/run | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/portainer/rootfs/etc/services.d/portainer/run b/portainer/rootfs/etc/services.d/portainer/run index 8a9a882..3fc51bc 100644 --- a/portainer/rootfs/etc/services.d/portainer/run +++ b/portainer/rootfs/etc/services.d/portainer/run @@ -4,6 +4,7 @@ # Runs portainer # ============================================================================== declare -a options +export AGENT_SECRET bashio::log.info 'Starting Portainer...' @@ -28,5 +29,10 @@ if ! bashio::fs.file_exists "/data/hidden"; then touch /data/hidden fi +# Export agent secret, if defined +if bashio::config.has_value 'agent_secret' ; then + AGENT_SECRET=$(bashio::config 'agent_secret') +fi + # Run Portainer exec /opt/portainer/portainer "${options[@]}"