diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 13:01:34 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 13:01:34 +0000 |
commit | fbeaf4fd5f08a2a60dcd05be81078aff621336af (patch) | |
tree | 973420782fa2d6092e71c193072a549b8933c664 | |
parent | e0fa7ccf2664ae75320fc25e638e72ce14a2c9ed (diff) |
correctly pick up current configuration of /etc/nsswitch.conf when running dpkg-reconfigure
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1460 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | debian/libnss-ldapd.config | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/debian/libnss-ldapd.config b/debian/libnss-ldapd.config index 92e6d34..d5331b7 100644 --- a/debian/libnss-ldapd.config +++ b/debian/libnss-ldapd.config @@ -15,13 +15,14 @@ db_version 2.0 # parse /etc/nsswitch.conf and see which services have ldap specified db_get libnss-ldapd/nsswitch -if [ -z "$RET" ] +# find name services that currently use LDAP +configured=`sed -n 's/^\([a-z]*\):.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p' /etc/nsswitch.conf` +# separate by commas +configured=`echo $configured | sed 's/ /, /g'` +# store configured services either on first config or when ldap is already +# configured +if [ -z "$RET" ] || [ -n "$configured" ] then - # find name services that currently use LDAP - configured=`sed -n 's/^\([a-z]*\):.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p' /etc/nsswitch.conf` - # separate by commas - configured=`echo $configured | sed 's/ /, /g'` - # store configured services db_set libnss-ldapd/nsswitch "$configured" fi |