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 #=================================================