Browse Source

openldap-2.4.46-2.hyperbola8: move conditional sentences to the post_install function

tags/milky-way/v0.3
André Silva 10 months ago
parent
commit
bc407ccd3f
2 changed files with 8 additions and 11 deletions
  1. +1
    -1
      openldap/PKGBUILD
  2. +7
    -10
      openldap/openldap.install

+ 1
- 1
openldap/PKGBUILD View File

@@ -7,7 +7,7 @@ pkgname=('openldap' 'libldap')
pkgver=2.4.46
_debver=2.4.46
_debrel=5~bpo9+1
pkgrel=2.hyperbola7
pkgrel=2.hyperbola8
arch=('i686' 'x86_64')
url="https://www.openldap.org/"
license=('OpenLDAP-2.8')

+ 7
- 10
openldap/openldap.install View File

@@ -5,20 +5,17 @@ post_install(){
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
# fix ldap user shell issue
ldap_shell=$(getent passwd ldap | cut -d: -f7)
if [ "$ldap_shell" != "/bin/nologin" ]; then
chsh -s /bin/nologin ldap &>/dev/null
fi
# add ldap user to adm group
ldap_group=$(groups ldap | sed 's|[ ]|\n|g' | grep adm)
if [ "$ldap_group" != "adm" ]; then
gpasswd -a ldap adm &>/dev/null
fi
}

post_remove(){

Loading…
Cancel
Save