From 929f820e941c0e398b57cd4e750a16174ef9cbcd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 28 Jun 2022 21:57:31 +0200 Subject: [PATCH] Apply example_ynh --- scripts/change_url | 4 ++++ scripts/restore | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c4d9d1b..99e8e31 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -108,12 +108,16 @@ domain=${new_domain%/} path=${new_path%/} dir="__DIR__" +ynh_backup_if_checksum_is_different --file="$final_path/config.php" + if [ "$new_path" == "/" ]; then ynh_add_config --template="../conf/config-domain.php" --destination="$final_path/config.php" else ynh_add_config --template="../conf/config-path.php" --destination="$final_path/config.php" fi +ynh_store_file_checksum --file="$final_path/config.php" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index 3c61a99..931c5ee 100644 --- a/scripts/restore +++ b/scripts/restore @@ -20,7 +20,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -59,7 +59,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -# Restore permissions on app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path"