mirror of
https://github.com/YunoHost-Apps/wordpress_ynh.git
synced 2024-09-03 20:36:10 +02:00
Backup config alternative
This commit is contained in:
parent
080deda83d
commit
2416ee9710
2 changed files with 8 additions and 0 deletions
|
@ -218,6 +218,10 @@ fi
|
|||
# Décommente les add_filter, qui auraient provoqué une erreur avec wp-cli
|
||||
sudo sed -i "s@//add_filter@add_filter@g" $final_path/wp-config.php
|
||||
|
||||
# Enregistre la somme de contrôle du fichier de config
|
||||
sudo yunohost app setting $app wp-config.php_file_md5 -v $(md5sum "$final_path/wp-config.php" | cut -d' ' -f1)
|
||||
|
||||
|
||||
# Configure les droits d'accès au fichiers
|
||||
# Les fichiers appartiennent à www-data, pour permettre les mises à jour.
|
||||
sudo chown -R www-data: $final_path
|
||||
|
|
|
@ -57,6 +57,10 @@ sudo chown root: $finalphpini
|
|||
sudo service php5-fpm reload
|
||||
|
||||
|
||||
config_file="$final_path/wp-config.php"
|
||||
if [ "$(sudo yunohost app setting $app wp-config.php_file_md5)" != $(md5sum "$config_file" | cut -d' ' -f1) ]; then
|
||||
sudo cp -a "$config_file" "$config_file.backup.$(date '+%d.%m.%y_%Hh%M,%Ss')" # Si le fichier de config a été modifié, créer un backup.
|
||||
fi
|
||||
if [ "$multisite" = "Yes" ];
|
||||
then
|
||||
sudo sed -i "s@#--MULTISITE--@@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
|
Loading…
Add table
Reference in a new issue