From 0ddca918ec8a9113d5cacd1fa306255915e930b4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 22 Jan 2021 13:40:22 +0100 Subject: [PATCH] Cleaning up --- scripts/change_url | 2 +- scripts/upgrade | 21 +++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 94b4c28..7de1f4a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -74,7 +74,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf diff --git a/scripts/upgrade b/scripts/upgrade index bad4cf5..5e77972 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,23 +9,13 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -# Set app specific variables -app=$YNH_APP_INSTANCE_NAME - -# Check destination directory -DESTDIR="/var/www/$app" -[[ ! -d $DESTDIR ]] && ynh_die \ -"The destination directory '$DESTDIR' does not exist.\ - The app is not correctly installed, you should remove it first." - #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 +app=$YNH_APP_INSTANCE_NAME + domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -82,7 +72,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -139,7 +129,6 @@ ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$admin_mail # Store file checksum to detected user modifications on upgrade ynh_store_file_checksum "$final_path/config/config.js" - #================================================= # INSTALL CRYPTPAD #================================================= @@ -171,7 +160,7 @@ ynh_add_systemd_config ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Set permissions on app files -chown -R $app:$app $final_path +chown -R $app: $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -185,7 +174,7 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="server available" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="server available" #================================================= # RELOAD NGINX