From f2caf232fbe219fd4303a2b0b09eda2a4fdf866d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 12 Jul 2021 12:35:11 +0200 Subject: [PATCH] Fix --- conf/data.sql | 4 ---- scripts/_common.sh | 24 ------------------------ scripts/install | 7 ++++++- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/conf/data.sql b/conf/data.sql index c51b513..b755974 100644 --- a/conf/data.sql +++ b/conf/data.sql @@ -39,7 +39,3 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key (21, 5,NULL,NULL,'is_default','\"1\"'); INSERT INTO `lime_settings_global` VALUES ('defaultlang','__LANGUAGE__'),('AssetsVersion','2620'); - -{% if is_public == "1" %} -UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21; -{% endif %} diff --git a/scripts/_common.sh b/scripts/_common.sh index 8349875..67e4fc3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -288,27 +288,3 @@ ynh_abort_if_up_to_date () { fi } - -ynh_version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } - -# In upgrade script allow to test if the app is less than or equal a specific version -# -# usage: ynh_version_le "0.5" -ynh_version_le() { - local version=$(ynh_read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" "version" || echo 1.0) - ynh_version_gt "$1" "${version}" -} - - -# Reload (or other actions) a service and print a log in case of failure. -# -# usage: ynh_system_reload service_name [action] -# | arg: service_name - Name of the service to reload -# | arg: action - Action to perform with systemctl. Default: reload -ynh_system_reload () { - local service_name=$1 - local action=${2:-reload} - - # Reload, restart or start and print the log if the service fail to start or reload - systemctl $action $service_name || ( journalctl --lines=20 -u $service_name >&2 && false) -} diff --git a/scripts/install b/scripts/install index 1e26c73..8df32ba 100755 --- a/scripts/install +++ b/scripts/install @@ -149,6 +149,11 @@ ynh_add_config --template="../conf/data.sql" --destination="$final_path/data.sql ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < $final_path/data.sql +if [ $is_public -eq 1 ] +then + ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" <<< "UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21;" +fi + #================================================= # Add nice themes #================================================= @@ -173,7 +178,7 @@ ynh_script_progression --message="Apply permissions..." --weight=1 #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ]