From 7b55d40d3d53e04615d8416d16da9f1a2c2a4003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:36:04 +0200 Subject: [PATCH] fix --- scripts/install | 7 +++++++ scripts/upgrade | 1 + sources/hooks/conf_regen/98-postfix_emailpoubelle | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 826a18d..5e09a50 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,13 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# RETRIEVE ARGUMENTS FROM THE MANIFEST +#================================================= + +password=$YNH_APP_ARG_PASSWORD +ynh_app_setting_set --app=$app --key=password --value=$password + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3587262..fd0ec39 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,6 +57,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." +password=$(ynh_app_setting_get --app=$app --key=password) ynh_add_config --template="../conf/conf-dist.php" --destination="$install_dir/conf.php" chmod 400 "$install_dir/conf.php" diff --git a/sources/hooks/conf_regen/98-postfix_emailpoubelle b/sources/hooks/conf_regen/98-postfix_emailpoubelle index 7ea9506..d63208d 100644 --- a/sources/hooks/conf_regen/98-postfix_emailpoubelle +++ b/sources/hooks/conf_regen/98-postfix_emailpoubelle @@ -1,7 +1,7 @@ #!/bin/bash source /usr/share/yunohost/helpers -final_path=$(ynh_app_setting_get emailpoubelle final_path) +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) set -e @@ -14,7 +14,7 @@ do_pre_regen() { # FIXME : check this file actually exists to not crash when only running this # hook alone - sudo sed -e "s@^virtual_alias_maps\s*=\s*\(.*\)@virtual_alias_maps = hash:$final_path/var/virtual,\1@"\ + sudo sed -e "s@^virtual_alias_maps\s*=\s*\(.*\)@virtual_alias_maps = hash:$install_dir/var/virtual,\1@"\ -i $postfix_main_cf }