mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-08 16:45:56 +02:00
Update run
This commit is contained in:
@@ -15,18 +15,22 @@ bashio::log.info "Starting Portainer..."
|
|||||||
# SET PASSWORD #
|
# SET PASSWORD #
|
||||||
################
|
################
|
||||||
|
|
||||||
|
# Set password
|
||||||
CURRENTPASSWORD=""
|
CURRENTPASSWORD=""
|
||||||
PASSWORD=$(bashio::config 'password')
|
PASSWORD=$(bashio::config 'password')
|
||||||
|
|
||||||
touch "/data/portainer_password"
|
touch "/data/portainer_password"
|
||||||
CURRENTPASSWORD=$( cat /data/portainer_password )
|
CURRENTPASSWORD=$( cat /data/portainer_password )
|
||||||
|
|
||||||
if [ "$CURRENTPASSWORD" != "$PASSWORD" ]; then
|
# Reset password if not first run
|
||||||
rm /data/portainer.db || true
|
if bashio::fs.file_exists "/data/hidden"; then
|
||||||
rm data/hidden || true
|
if [ "$CURRENTPASSWORD" != "$PASSWORD" ]; then
|
||||||
bashio::log.warning "... password changed, database reseted"
|
rm /data/portainer.db || true
|
||||||
|
rm data/hidden || true
|
||||||
|
bashio::log.warning "... password changed, database reseted"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Define option
|
||||||
echo -n $PASSWORD > /data/portainer_password
|
echo -n $PASSWORD > /data/portainer_password
|
||||||
options+=(--admin-password-file /data/portainer_password)
|
options+=(--admin-password-file /data/portainer_password)
|
||||||
bashio::log.info "... password set to $PASSWORD"
|
bashio::log.info "... password set to $PASSWORD"
|
||||||
|
|||||||
Reference in New Issue
Block a user