post_install() { if [ "$(getent group sshd | 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 systemctl enable slapd.service } post_upgrade() { pre_remove post_install } pre_remove() { systemctl stop slapd.service systemctl disable slapd.service } post_remove() { groupdel ldap 2>/dev/null || true userdel ldap 2>/dev/null || true }