Migrate database password on repair script
This commit is contained in:
parent
9b4ed83e28
commit
7bc9089801
|
@ -44,6 +44,18 @@ ADMIN_EMAIL_ADDRESS=${ADMIN_USERNAME}@${HOSTNAME}
|
|||
# Frequency - daily/weekly
|
||||
BACKUP_TYPE='daily'
|
||||
|
||||
|
||||
# migrate from database password file to using the password store
|
||||
DATABASE_PASSWORD_FILE=/root/dbpass
|
||||
if [ -f $DATABASE_PASSWORD_FILE ]; then
|
||||
MARIADB_PASSWORD=$(cat $DATABASE_PASSWORD_FILE)
|
||||
${PROJECT_NAME}-pass -u root -a mariadb -p "$MARIADB_PASSWORD"
|
||||
stored_password=$(${PROJECT_NAME}-pass -u root -a mariadb)
|
||||
if [[ "$stored_password" == "$MARIADB_PASSWORD" ]]; then
|
||||
shred -zu $DATABASE_PASSWORD_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
MYSQL_ROOT_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
|
||||
|
||||
TEMPFILE=/root/repair-database-$DATABASE
|
||||
|
|
Loading…
Reference in New Issue