From 110967fa73d5338aa889a05b5aa3cc9a2e0eb477 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Thu, 19 Oct 2017 12:31:32 +0200 Subject: [PATCH] Let's make this app a multi-instance one --- check_process | 2 +- manifest.json | 2 +- scripts/backup | 2 +- scripts/install | 12 ++++++------ scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/check_process b/check_process index f4f09fd..88a7a7e 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,7 @@ setup_public=1 upgrade=1 backup_restore=1 - multi_instance=0 + multi_instance=1 wrong_user=1 wrong_path=1 incorrect_path=1 diff --git a/manifest.json b/manifest.json index 32eb42e..13aa619 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "name": "mbugeia", "email": "maxime@max.privy.place" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx", "php5-fpm", diff --git a/scripts/backup b/scripts/backup index 44a7a43..eb29fb2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers # Abort script if errors ynh_abort_if_errors -app="kanboard" +app=$YNH_APP_INSTANCE_NAME # Set app specific variables dbname=$app diff --git a/scripts/install b/scripts/install index 1c37c5c..0448252 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -app="kanboard" - # Source local helpers source ./_common.sh @@ -12,10 +10,12 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Retrieve arguments -domain=$1 -path=$2 -admin=$3 -is_public=$4 +domain=$YNH_APP_ARG_DOMAIN +path=$YNH_APP_ARG_PATH +admin=$YNH_APP_ARG_ADMIN +is_public=$YNH_APP_ARG_IS_PUBLIC + +app=$YNH_APP_INSTANCE_NAME # TODO: Check domain/path availability with app helper yunohost app checkurl "${domain}${path}" -a "$app" \ diff --git a/scripts/remove b/scripts/remove index f2011ed..5e25244 100644 --- a/scripts/remove +++ b/scripts/remove @@ -6,7 +6,7 @@ source ./_common.sh # Source app helpers source /usr/share/yunohost/helpers -app="kanboard" +app=$YNH_APP_INSTANCE_NAME dbname=$app dbuser=$app diff --git a/scripts/restore b/scripts/restore index 131d191..8bf1ba6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,7 +9,7 @@ source /usr/share/yunohost/helpers # Abort script if errors ynh_abort_if_errors -app="kanboard" +app=$YNH_APP_INSTANCE_NAME # Set app specific variables dbname=$app diff --git a/scripts/upgrade b/scripts/upgrade index 9098528..b795b7d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,7 +9,7 @@ source /usr/share/yunohost/helpers # Abort script if errors ynh_abort_if_errors -app="kanboard" +app=$YNH_APP_INSTANCE_NAME # Set app specific variables dbname=$app