From 20879973c19a22f5625144d937047aa8b8698e27 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Fri, 22 Dec 2017 18:49:19 +0100 Subject: [PATCH] Add admin for restore --- scripts/_common.sh | 17 +++++++++++++++++ scripts/restore | 1 + 2 files changed, 18 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 883fe5e..522fde5 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -343,6 +343,23 @@ ynh_exec_fully_quiet () { eval $@ > /dev/null 2>&1 } +# Remove any logs for all the following commands. +# +# usage: ynh_print_OFF +# WARNING: You should be careful with this helper, and never forgot to use ynh_print_ON as soon as possible to restore the logging. +ynh_print_OFF () { + set +x +} + +# Restore the logging after ynh_print_OFF +# +# usage: ynh_print_ON +ynh_print_ON () { + set -x + # Print an echo only for the log, to be able to know that ynh_print_ON has been called. + echo ynh_print_ON > /dev/null +} + #================================================= # Install or update the main directory yunohost.multimedia diff --git a/scripts/restore b/scripts/restore index 305e1e9..17ecea5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,6 +33,7 @@ domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) final_path=$(ynh_app_setting_get $app final_path) enable_dhcp=$(ynh_app_setting_get $app enable_dhcp) +admin=$(ynh_app_setting_get $app admin) #================================================= # CHECK IF THE APP CAN BE RESTORED