Ghost restore database password

This commit is contained in:
Bob Mottram 2017-06-25 17:35:16 +01:00
parent f99ed7f79f
commit 8f80033313
1 changed files with 9 additions and 0 deletions

View File

@ -234,6 +234,10 @@ function restore_local_ghost {
function_check restore_database function_check restore_database
restore_database ghost ${GHOST_DOMAIN_NAME} restore_database ghost ${GHOST_DOMAIN_NAME}
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
sed -i "s|password :.*|password : '${MARIADB_PASSWORD}',|g" $ghost_config
systemctl start ghost systemctl start ghost
restart_site restart_site
fi fi
@ -274,6 +278,11 @@ function restore_remote_ghost {
ghost_create_database ghost_create_database
restore_database_from_friend ghost ${GHOST_DOMAIN_NAME} restore_database_from_friend ghost ${GHOST_DOMAIN_NAME}
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
sed -i "s|password :.*|password : '${MARIADB_PASSWORD}',|g" $ghost_config
systemctl start ghost systemctl start ghost
restart_site restart_site
chown -R ghost: /var/www/$GHOST_DOMAIN_NAME/htdocs/ chown -R ghost: /var/www/$GHOST_DOMAIN_NAME/htdocs/