mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 18:43:39 +02:00
Add password reset
This commit is contained in:
@@ -15,10 +15,18 @@ bashio::log.info "Starting Portainer..."
|
|||||||
# SET PASSWORD #
|
# SET PASSWORD #
|
||||||
################
|
################
|
||||||
|
|
||||||
if ! bashio::fs.file_exists "/data/portainer_password"; then
|
CURRENTPASSWORD=""
|
||||||
fi
|
|
||||||
|
|
||||||
PASSWORD=$(bashio::config 'password')
|
PASSWORD=$(bashio::config 'password')
|
||||||
|
|
||||||
|
if ! bashio::fs.file_exists "/data/portainer_password"; then
|
||||||
|
CURRENTPASSWORD=$( cat /data/portainer_password )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $CURRENTPASSWORD != $PASSWORD ]; then
|
||||||
|
rm /data/portainer.db
|
||||||
|
bashio::log.warning "... password changed, database reseted"
|
||||||
|
fi
|
||||||
|
|
||||||
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