From 7716439b3ac0f8a85757b2d24fca94988a3bbde3 Mon Sep 17 00:00:00 2001 From: Moul Date: Sat, 18 Jun 2016 09:36:30 +0000 Subject: [PATCH] [enh] remove and upgrade scripts: use helpers. --- scripts/remove | 6 +++--- scripts/upgrade | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/remove b/scripts/remove index 3f03082..e43b67c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,11 @@ #!/bin/bash -app=$YNH_APP_INSTANCE_NAME -domain=$(sudo yunohost app setting $app domain) - # Source YunoHost helpers source /usr/share/yunohost/helpers +app=$YNH_APP_INSTANCE_NAME +domain=$(ynh_app_setting_get $app domain) + # Remove sources sudo rm -rf /var/www/$app diff --git a/scripts/upgrade b/scripts/upgrade index 6b57dbe..67f035c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,16 +3,16 @@ # Exit on command errors and treat unset variables as an error set -eu -# Retrieve arguments -app=$YNH_APP_INSTANCE_NAME -domain=$(sudo yunohost app setting $app domain) -path=$(sudo yunohost app setting $app path) -admin=$(sudo yunohost app setting $app admin) -is_public=$(sudo yunohost app setting $app is_public) - # Source YunoHost helpers source /usr/share/yunohost/helpers +# Retrieve arguments +app=$YNH_APP_INSTANCE_NAME +domain=$(ynh_app_setting_get $app domain) +path=$(ynh_app_setting_get $app path) +admin=$(ynh_app_setting_get $app admin) +is_public=$(ynh_app_setting_get $app is_public) + # Remove trailing "/" for next commands path=${path%/} @@ -45,7 +45,7 @@ sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf # If app is public, add url to SSOWat conf as skipped_uris if [ "$is_public" = "Yes" ]; then - sudo yunohost app setting $app unprotected_uris -v "/" + ynh_app_setting_set $app unprotected_uris "/" fi # Reload nginx service