From 8d1dbc368448b1933dee47d10b50c3fd3bc4e465 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 27 Feb 2019 21:45:03 +0100 Subject: [PATCH] Retrieve service_name --- scripts/remove | 3 +-- scripts/upgrade | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index 292641c..f3fbfa1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -33,8 +33,7 @@ ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) - -service_name="ynh-vpnclient" +service_name=$(ynh_app_setting_get $app service_name) service_checker_name=$service_name"-checker" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2b188cc..3f17461 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,10 +21,10 @@ path_url=$(ynh_app_setting_get $app path) is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) server_name=$(ynh_app_setting_get $app server_name) - -service_name="ynh-vpnclient" +service_name=$(ynh_app_setting_get $app service_name) service_checker_name=$service_name"-checker" + #================================================= # SPECIAL UPGRADE FOR VERSIONS < 1.2.0 #================================================= @@ -42,6 +42,12 @@ if [ -f /etc/php5/fpm/pool.d/vpnadmin.conf ]; then fi test -d /var/www/vpnadmin && mv /var/www/vpnadmin /var/www/${app} +if [ -z $service_name ]; then + service_name="ynh-vpnclient" + service_checker_name=$service_name"-checker" + ynh_app_setting_set "$app" service_name "$service_name" +fi + ## Versions known to have a buggy backup script #buggy_versions="1.0.0 1.0.1 1.1.0" #curr_version=$(read_manifest version)