From c6466a7d2b56759290ee5dd834fa46d8de251858 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Apr 2019 21:29:47 +0200 Subject: [PATCH] implement ynh_clean_check_starting --- scripts/backup | 2 +- scripts/install | 7 +++++-- scripts/restore | 2 +- scripts/upgrade | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index f19b290..749292f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/install b/scripts/install index f17d47d..8d1594f 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ynh_clean_check_starting +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -112,6 +115,7 @@ ynh_add_systemd_config #================================================= # MODIFY A CONFIG FILE #================================================= +ynh_print_info "Modifying a config file..." mkdir -p "$final_path/.config/syncthing" config_file="$final_path/.config/syncthing/config.xml" @@ -162,8 +166,7 @@ systemctl reload nginx #================================================= ynh_print_info "Starting Syncthing services..." -ynh_systemd_action --action=start --service_name=$app --log_path=systemd -#--line_match="Started $app" +ynh_systemd_action --action=start --service_name=$app --log_path=systemd --line_match="Access the GUI via the following URL" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 76f329a..b933e6e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/upgrade b/scripts/upgrade index a65b426..66dbaba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,6 +33,7 @@ ynh_print_info "Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # restore it if the upgrade fails ynh_restore_upgradebackup }