From 006b3ad7b8ff483435110f6309c5e54bc5111604 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Wed, 29 Oct 2025 09:04:02 +0100 Subject: [PATCH] Updated fds.in (cosmetic changes). --- .../install-data/usr/local/bin/backupfds.sh | 2 ++ .../usr/local/bin/replacedirsrvcerts.sh | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/backupfds.sh b/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/backupfds.sh index f03a77e..704f6f6 100755 --- a/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/backupfds.sh +++ b/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/backupfds.sh @@ -22,6 +22,8 @@ create_instance_create_template() SECURE_PORT=$(dsconf $INSTANCE config get nsslapd-securePort \ | cut -f 2 -d ' ') echo "secure_port = $SECURE_PORT" >>$CREATE_TEMPLATE + DMPASSWORD=$(/usr/bin/pwdhash Passw@rd01) + echo "root_password = $DMPASSWORD" >>$CREATE_TEMPLATE SUFFIXES=$(dsconf $INSTANCE backend suffix list) echo "$SUFFIXES" | while read SUFFIX_BACKEND do diff --git a/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/replacedirsrvcerts.sh b/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/replacedirsrvcerts.sh index 2c1d251..15eca1a 100755 --- a/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/replacedirsrvcerts.sh +++ b/sources/fds.in/c3d/postinstall/install-data/usr/local/bin/replacedirsrvcerts.sh @@ -7,9 +7,10 @@ LETSENCRYPT_CERT_NAME=useribm TMP_PATH=$(mktemp --directory) -if [ -d $LETSENCRYPT_BASE_PATH ] -then +replace_cert() +{ CERT_PATH=$LETSENCRYPT_BASE_PATH/live/$LETSENCRYPT_CERT_NAME + DIRSRV_INSTANCE=$1 for CACERT in ca-certificate certificate do @@ -46,6 +47,18 @@ then $CERT_PATH/privkey.pem dsctl $DIRSRV_INSTANCE restart +} + +if [ ! -d $LETSENCRYPT_BASE_PATH ] +then + echo "$LETSENCRYPT_BASE_PATH does not exist, exiting." >&2 + exit 1 fi +dsctl --list | sed 's/^slapd-//' >$TMP_PATH/instances +while read INSTANCE +do + replace_cert $INSTANCE +done <$TMP_PATH/instances + rm --force --recursive $TMP_PATH -- 2.54.0