1234567891011121314151617181920212223242526272829 |
- post_install(){
- if ! getent group ldap &>/dev/null; then
- groupadd -g 439 ldap >/dev/null
- fi
- if ! getent passwd ldap &>/dev/null; then
- useradd -u 439 -g ldap -G adm -d /var/lib/openldap -s /bin/nologin ldap >/dev/null
- fi
- if ! groups ldap | grep adm &>/dev/null; then
- gpasswd -a ldap adm >/dev/null
- fi
- ldap_shell=$(getent passwd ldap | cut -d: -f7)
- if [ "$ldap_shell" != '/bin/nologin' ]; then
- chsh -s /bin/nologin ldap &>/dev/null
- fi
- }
- post_upgrade(){
- post_install
- }
- post_remove(){
- if getent passwd ldap &>/dev/null; then
- userdel ldap >/dev/null
- fi
- if getent group ldap &>/dev/null; then
- groupdel ldap >/dev/null
- fi
- }
|