Browse Source

Add admin for restore

Maniack Crudelis 8 years ago
parent
commit
20879973c1
2 changed files with 18 additions and 0 deletions
  1. 17 0
      scripts/_common.sh
  2. 1 0
      scripts/restore

+ 17 - 0
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

+ 1 - 0
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