openldap/openldap.install

20 lines
447 B
Plaintext
Raw Permalink Normal View History

2024-10-31 21:53:58 +08:00
post_install() {
if [ "$(getent group ldap | cut -d ":" -f 3)" != "83" ]; then
groupadd -g 83 ldap
fi
if [ "$(getent passwd ldap | cut -d ":" -f 3)" != "83" ]; then
useradd -c 'OpenLDAP Daemon Owner' \
-d /var/lib/openldap -u 83 \
-g ldap -s /bin/false ldap
fi
}
post_upgrade() {
post_install
}
post_remove() {
groupdel ldap 2>/dev/null || true
userdel ldap 2>/dev/null || true
}