From 62e9e411a7aafcd306769600ab2fb9a50254b533 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sat, 30 Oct 2021 09:59:53 +0200 Subject: [PATCH] Fix: install / upgrade script issues --- scripts/install | 2 -- scripts/upgrade | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 9369b3d..349068d 100755 --- a/scripts/install +++ b/scripts/install @@ -119,9 +119,7 @@ ynh_script_progression --message="Setting up source files..." --weight=2 # Download, check integrity, uncompress and patch the source from app.src mkdir -p "$final_path/live" ynh_setup_source --source_id=app_syncing-server-js --dest_dir="$final_path/live/syncing-server-js" -ynh_setup_source --source_id=app_syncing-server-js --dest_dir="$final_path/live/syncing-server-js-worker" ynh_setup_source --source_id=app_auth --dest_dir="$final_path/live/auth" -ynh_setup_source --source_id=app_auth --dest_dir="$final_path/live/auth-worker" ynh_setup_source --source_id=app_api-gateway --dest_dir="$final_path/live/api-gateway" chmod 750 "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index a253da2..dbc3ad9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -267,6 +267,14 @@ then ynh_remove_app_dependencies fi +# Remove unneeded data +if [ -e "$final_path/live/syncing-server-js-worker" ]; then + ynh_secure_remove --file="$final_path/live/syncing-server-js-worker" +fi +if [ -e "$final_path/live/auth-worker" ]; then + ynh_secure_remove --file="$final_path/live/auth-worker" +fi + #================================================= # CREATE DEDICATED USER #================================================= @@ -293,7 +301,7 @@ then ynh_backup_if_checksum_is_different --file=$config_syncing_server_js ynh_backup_if_checksum_is_different --file=$config_syncing_server_js_worker # Remove destination directory - ynh_secure_remove --file="$final_path/live/syncing_server_js" + ynh_secure_remove --file="$final_path/live/syncing-server-js" ynh_secure_remove --file="$config_syncing_server_js" ynh_secure_remove --file="$config_syncing_server_js_worker" # Download, check integrity, uncompress and patch the source from app.src @@ -320,7 +328,7 @@ then # Backup files to keep ynh_backup_if_checksum_is_different --file=$config_api_gateway # Remove destination directory - ynh_secure_remove --file="$final_path/live/api_gateway" + ynh_secure_remove --file="$final_path/live/api-gateway" ynh_secure_remove --file="$config_api_gateway" # Download, check integrity, uncompress and patch the source from app.src mkdir -p "$final_path/live"