From adda84094db605a3559333ed20e4e924a2629176 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 9 Jan 2021 15:00:41 +0100 Subject: [PATCH] Restore _common.sh var and set some comments --- scripts/_common.sh | 3 +++ scripts/change_url | 3 +++ scripts/install | 7 ++++++- scripts/restore | 5 ++++- scripts/upgrade | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9cd55c6..d717f42 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,6 +3,9 @@ PKG_DEPENDENCIES="sqlite3 libldap2-dev libsasl2-dev python3-dev imagemagick python3-lxml libjpeg-dev" DOSSIER_MEDIA=/home/yunohost.multimedia +#These var are used in init_calibre_db_settings conf file +LOG_FILE=/var/log/$app/$app.log +ACCESS_LOG_FILE=/var/log/$app/$app-access.log #================================================= # EXPERIMENTAL HELPERS # TO BE DELETED WHEN RELEASED diff --git a/scripts/change_url b/scripts/change_url index cbed4c2..44657d9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -26,6 +26,9 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get $app final_path) port=$(ynh_app_setting_get $app port) + +#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script +#when initializing the conf file of the app source _common.sh #================================================= diff --git a/scripts/install b/scripts/install index b807e14..cc3d20f 100755 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh + source /usr/share/yunohost/helpers #================================================= @@ -23,6 +23,11 @@ language=$YNH_APP_ARG_LANGUAGE upload=$YNH_APP_ARG_UPLOAD public_library=$YNH_APP_ARG_PUBLIC_LIBRARY +#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script +#when initializing the conf file of the app +source _common.sh + + #if app is public, we assume library is public if [ $is_public -eq 1 ]; then public_library=1 diff --git a/scripts/restore b/scripts/restore index 8bd3aea..bcb735f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -30,6 +29,10 @@ calibre_dir=$(ynh_app_setting_get $app calibre_dir) is_public=$(ynh_app_setting_get $app is_public) port=$(ynh_app_setting_get $app port) +#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script +#when initializing the conf file of the app +source ../settings/scripts/_common.sh + #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 44a58c5..f5450dc 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,10 @@ is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) language=$(ynh_app_setting_get $app language) +#Source common.sh required to be after var initialization as some variables are updated in it that are then used in the script +#when initializing the conf file of the app +source _common.sh + #Get settings from database in case it has been changed in the app and save it in settings so that it can be used back afterward calibre_dir=$(sqlite3 $final_path/app.db "SELECT config_calibre_dir FROM settings WHERE ID=1") calibre_dir=${calibre_dir%/}