pe que là ça fonctionne mieux ?

This commit is contained in:
Valentin 2024-05-31 16:21:41 +02:00
parent feb4a67d82
commit 37abb1e301
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ if [[ "$answer" == "y" ]]; then
rm $backup_archive
backup_directory="/home/${username}$(ls \"/home/${username}/\" | grep \"${site_name}_export\")"
backup_directory="/home/${username}/"$(ls "/home/${username}/" | grep "${site_name}_export")
db_export=$(ls "${backup_directory}/db"*)
db_password=$(cat /var/www/repositories/cms*/.env | grep DB_PASSWORD | sed "s/[^']*'\([^']*\)'.*/\1/")
@ -35,11 +35,11 @@ if [[ "$answer" == "y" ]]; then
mariadb -u directus "-p${db_password}" -e "DROP DATABASE IF EXISTS directus; CREATE DATABASE directus;"
mariadb -u directus "-p${db_password}" directus < $db_export
cms_directory=$(ls /var/www/repository/cms*)
cms_directory="/var/www/repository/"$(ls /var/www/repository | grep cms)
mv -f "${backup_directory}/uploads" $cms_directory
rm -r backup_directory
rm -r $backup_directory
else
echo -e "${PURPLE}${BOLD}Please import a .tar.gz backup in /home/${username}${RESET}"
fi