From 0a03be9c666ded42757c27c1fc9656bc9df02f2c Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Sun, 17 Nov 2024 19:49:50 -0300 Subject: [PATCH] add debconf template and fix sed --- DEBIAN/postinst | 14 +++++++++----- templates | 6 ++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 templates diff --git a/DEBIAN/postinst b/DEBIAN/postinst index 44a85dc..992bea7 100755 --- a/DEBIAN/postinst +++ b/DEBIAN/postinst @@ -1,6 +1,10 @@ -#!/bin/sh +#!/bin/bash +set -e -# Script executado pós instalação -# systemctl restart nscd -PASS=$(whiptail --passwordbox "Senha do LDAP" 10 50) -sed -i 's/BINDPW/$PASS/' /etc/sssd/sssd.conf +. /usr/share/debconf/confmodule + +db_get alice-auth/ldap-bind-password +LDAP_BIND_PASSWORD="$RET" +CONFIG=/etc/sssd/sssd.conf + +sed -i "s/ldap_default_authtok =.*/ldap_default_authtok = $LDAP_BIND_PASSWORD/" $CONFIG diff --git a/templates b/templates new file mode 100644 index 0000000..631d606 --- /dev/null +++ b/templates @@ -0,0 +1,6 @@ +Template: alice-auth/ldap-bind-password +Type: password +Default: +Description: Digite a senha do LDAP. + Senha do user Alice. +