From 36d5a3905a6ceb791f19a8e6b1f645b8c85c8128 Mon Sep 17 00:00:00 2001 From: opi Date: Sat, 7 May 2016 02:00:48 +0200 Subject: [PATCH] [enh] Use latest backup specification. --- manifest.json | 5 ++++- scripts/backup | 9 ++++++--- scripts/restore | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 7ea38b7..580b437 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,10 @@ "name": "Shell In A Box", "id": "shellinabox", "packaging_format": 1, - "description": { + "requirements": { + "yunohost": ">> 2.3.15" + }, + "description": { "en": "Web based AJAX terminal emulator", "fr": "Émulateur de terminal web" }, diff --git a/scripts/backup b/scripts/backup index a6c1912..383377c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -3,8 +3,11 @@ # causes the shell to exit if any subcommand or pipeline returns a non-zero status set -e -# Retrieve arguments -app="shellinabox" +# Source YNH helpers +. /usr/share/yunohost/helpers + +app=${!#} + domain=$(sudo yunohost app setting $app domain) # Backup directory location for the app from where the script is executed and @@ -13,4 +16,4 @@ backup_dir=$YNH_APP_BACKUP_DIR # Copy the conf files sudo mkdir -p ./conf -sudo cp -a "/etc/nginx/conf.d/${domain}.d/${app}.conf" ./conf/nginx.conf \ No newline at end of file +ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" ./conf/nginx.conf \ No newline at end of file diff --git a/scripts/restore b/scripts/restore index 9e4029f..9844c5f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -4,7 +4,8 @@ set -e # Retrieve arguments -app="shellinabox" +app=${!#} + domain=$(sudo yunohost app setting $app domain) path=$(sudo yunohost app setting $app path)