From 6a8e977bd714eb5a9fb0eb9586a7c1a1d12c57f2 Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Thu, 4 Jul 2019 12:03:16 +0200 Subject: [PATCH] Fix from kay0u suggestion --- pull_request.md | 2 +- scripts/upgrade | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pull_request.md b/pull_request.md index 709500b..6a22559 100644 --- a/pull_request.md +++ b/pull_request.md @@ -9,4 +9,4 @@ - [ ] Tested with Package_check. - [ ] Fix or enhancement tested. - [ ] Upgrade from last version tested. -- [ Can be reviewed and tested. +- [ ] Can be reviewed and tested. diff --git a/scripts/upgrade b/scripts/upgrade index 8c46cf9..7464447 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,12 +144,15 @@ then # Remove the lock if it exists lock=$final_path/documents/install.lock - [[ -f $lock ]] && sudo rm $lock + if -f $lock + then + ynh_secure_remove $lock + fi mkdir -p /var/log/$app/ # Upgrade with CURL - cd $final_path/htdocs/install/ + pushd $final_path/htdocs/install/ if php upgrade.php $current_version $update_version > /var/log/$app/upgrade.html; then ynh_print_info --message="Step 1 upgrading ended successfully" else @@ -165,6 +168,7 @@ then else ynh_print_warn --message="Step 3 upgrading ended with error" fi + popd fi #=================================================