From 196af58477886dc0db0bde1dddd7029131916f59 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sat, 7 Jul 2018 18:24:51 +0200 Subject: [PATCH] [enh] during 'upgrade', copy LDAP config See https://github.com/YunoHost-Apps/dokuwiki_ynh/pull/37#discussion_r200142881 --- scripts/upgrade | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e78c066..24c33aa 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -196,16 +196,26 @@ done #================================================= +#================================================= +# LDAP Configuration +#================================================= + # Verify if existing file needs to be upgraded by comparing it's size to new file from package # If different, do a backup of existing file and overwrite with new file -# +# # Safe here as this file is only used by Yunohost. Dokuwiki cannot modified it. ynh_backup_if_checksum_is_different "$final_path/conf/local.protected.php" +# Set the "admin" user +ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "../conf/local.protected.php" + +cp ../conf/local.protected.php $final_path/conf +# This File cannot be modified directly by Dokuwiki, only by hand or by Yunohost +# It will only be updated by Yunohost package or directly by adventurous users + # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/conf/local.protected.php" - #================================================= # GENERIC FINALIZATION #=================================================