From c0b069384a80ad42da4998650c83119de9076615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 13 Mar 2024 01:21:48 +0100 Subject: [PATCH] Fix restore: restore / fix config.xml --- conf/config.xml | 2 +- scripts/restore | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/config.xml b/conf/config.xml index 747c329..8c72176 100644 --- a/conf/config.xml +++ b/conf/config.xml @@ -14,4 +14,4 @@ False - \ No newline at end of file + diff --git a/scripts/restore b/scripts/restore index bc63c4a..cef1846 100755 --- a/scripts/restore +++ b/scripts/restore @@ -18,6 +18,21 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:" "$install_dir" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +chown -R "$app:www-data" "$data_dir" + +if [ ! -f "$data_dir/config.xml" ]; then + ynh_add_config --template="config.xml" --destination="$data_dir/config.xml" + chmod 400 "$data_dir/config.xml" + chown "$app:$app" "$data_dir/config.xml" +fi + #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #=================================================