From c0f8b5a439207691f8620fffcaf0785d4afb8216 Mon Sep 17 00:00:00 2001 From: rodinux Date: Wed, 20 Sep 2023 19:59:26 +0200 Subject: [PATCH] secure remove unused files --- scripts/upgrade | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7c88dfc..e9d91df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,7 +42,7 @@ if [[ -f "$install_dir/config.local.user.php" ]]; then cp -a $install_dir/config.local.user.php $tmp_data_backup/ fi -if [[ $(grep "Garradin" $tmp_data_backup/config.local.user.php) ]] ; then +if [[ $(grep "Garradin" "$tmp_data_backup/config.local.user.php") ]] ; then ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$tmp_data_backup/config.local.user.php" fi @@ -130,6 +130,16 @@ sleep 5 # remove data directory backup ynh_secure_remove --file="$tmp_data_backup" +# clean duplicate folder if exist +if [[ -d "$install_dir/data/data" ]]; then + ynh_secure_remove --file="$install_dir/data/data" +fi + +# clean unused file if exist +if [[ -f "$install_dir/config.local.user.php" ]]; then + ynh_secure_remove --file="$install_dir/config.local.user.php" +fi + #================================================= # END OF SCRIPT #=================================================