Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/debian/libnss-ldapd.config
blob: c398ec047f25972af5418c54ca406a55c195a043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

set -e

# source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

#
# This is the fist part of the script. In this part an attempt
# is made to get or guess the current configuration. This information
# is used later on to prompt the user and to provide a sensible
# default.
#

# parse /etc/nsswitch.conf and see which services have ldap specified
configured=`sed -n 's/^\([a-z]*\):.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p' /etc/nsswitch.conf`
if [ -n "$configured" ]
then
  # separate by commas
  configured=`echo $configured | sed 's/ /, /g'`
  # store configured services
  db_set libnss-ldapd/nsswitch "$configured"
fi

#
# This is the second part of the script. In this part the configurable
# settings will be presented to the user for approval. The postinst
# will finaly perform the actual modifications.
#

# ask for which nsswitch options to configure
db_capb multiselect
db_input high libnss-ldapd/nsswitch || true
db_go || true

exit 0