Files
alice-auth/DEBIAN/postinst
T
Carneiro 60f506b2c7
Deploy Package / Explore-Gitea-Actions (push) Successful in 11s
Update DEBIAN/postinst
2024-11-18 08:38:36 -03:00

21 lines
532 B
Bash
Executable File

#!/bin/bash
set -e
. /usr/share/debconf/confmodule
db_get alice-auth/ldap-bind-password
SSSD_CONFIG=/etc/sssd/sssd.conf
SSHD_CONFIG=/etc/ssh/sshd_config
sed -i "s/ldap_default_authtok =.*/ldap_default_authtok = $RET/" $SSSD_CONFIG
sed -i "s/#AuthorizedKeysCommand/AuthorizedKeysCommand/" $SSHD_CONFIG
sed -i "/AuthorizedKeysCommand\( \|$\)/s/AuthorizedKeysCommand.*/AuthorizedKeysCommand \/usr\/bin\/sss_ssh_authorizedkeys/" $SSHD_CONFIG
chmod 600 $SSSD_CONFIG
chown root:root $SSSD_CONFIG
systemctl restart sssd autofs ssh