Skip to content
Snippets Groups Projects
Commit 86d1c1a7 authored by Bob Mottram's avatar Bob Mottram
Browse files

Set database password on koel restore

parent 50c64e26
No related branches found
No related tags found
No related merge requests found
......@@ -323,7 +323,7 @@ function backup_local_koel {
source_directory=/var/www/${KOEL_DOMAIN_NAME}/htdocs
if [ -d $source_directory ]; then
systemctl stop koal
systemctl stop koel
dest_directory=koel
function_check suspend_site
......@@ -338,7 +338,7 @@ function backup_local_koel {
function_check restart_site
restart_site
systemctl start koal
systemctl start koel
fi
}
......@@ -349,7 +349,7 @@ function restore_local_koel {
KOEL_DOMAIN_NAME=$(get_completion_param "koel domain")
if [ $KOEL_DOMAIN_NAME ]; then
echo $"Restoring koel"
systemctl stop koal
systemctl stop koel
temp_restore_dir=/root/tempkoel
koel_dir=/var/www/${KOEL_DOMAIN_NAME}/htdocs
......@@ -361,7 +361,13 @@ function restore_local_koel {
if [ -d $temp_restore_dir ]; then
rm -rf $temp_restore_dir
fi
systemctl start koal
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
cd /var/www/$KOEL_DOMAIN_NAME/htdocs
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$MARIADB_PASSWORD|g" .env
MARIADB_PASSWORD=
systemctl start koel
fi
}
......@@ -370,7 +376,7 @@ function backup_remote_koel {
KOEL_DOMAIN_NAME=$(get_completion_param "koel domain")
temp_backup_dir=/var/www/${KOEL_DOMAIN_NAME}/htdocs
if [ -d $temp_backup_dir ]; then
systemctl stop koal
systemctl stop koel
function_check suspend_site
suspend_site ${KOEL_DOMAIN_NAME}
......@@ -386,7 +392,7 @@ function backup_remote_koel {
function_check restart_site
restart_site
systemctl start koal
systemctl start koel
else
echo $"koel domain specified but not found in ${temp_backup_dir}"
fi
......@@ -397,7 +403,7 @@ function restore_remote_koel {
if grep -q "koel domain" $COMPLETION_FILE; then
echo $"Restoring koel"
systemctl stop koal
systemctl stop koel
KOEL_DOMAIN_NAME=$(get_completion_param "koel domain")
......@@ -410,7 +416,12 @@ function restore_remote_koel {
rm -rf /root/tempkoel
fi
systemctl start koal
MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
cd /var/www/$KOEL_DOMAIN_NAME/htdocs
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$MARIADB_PASSWORD|g" .env
MARIADB_PASSWORD=
systemctl start koel
echo $"Restore of koel complete"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment