From 388571aef25f5c911f6739b4baee2f28ed5b5d50 Mon Sep 17 00:00:00 2001 From: siwinter <45730097+siwinter@users.noreply.github.com> Date: Sun, 21 Mar 2021 18:48:35 +0100 Subject: [PATCH] Update restore --- scripts/restore | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/restore b/scripts/restore index a8017a8..d6f4608 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,7 +20,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -36,7 +36,7 @@ cmd_file="/usr/local/bin/mopidyctl" #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." --weight=3 test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -62,7 +62,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell @@ -70,7 +70,7 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" # /opt/yunohost/mopidy @@ -86,7 +86,7 @@ ynh_restore_file --origin_path="$final_path" # /opt/yunohost/mopidy #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 +ynh_script_progression --message="Reinstalling dependencies..." --weight=50 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -94,7 +94,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -102,7 +102,7 @@ systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --log_type systemd --description "this is mopidy, a music server" @@ -117,7 +117,7 @@ ynh_restore_file --origin_path="$cmd_file" # /usr/local/bin/mopidyctl #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" @@ -126,7 +126,7 @@ ynh_systemd_action --service_name=$app --action="start" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -134,4 +134,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last +ynh_script_progression --message="Restoration completed for $app" --last