blob: 4fc68bb88d7c31f0510f86a3fe403b1285980cb0 (
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
|
#!/bin/sh
set -e
CONFFILE="/etc/nss-ldapd.conf"
# source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0
# set title
db_title "Configuring libnss-ldapd"
# parse /etc/nsswitch.conf and see which services have ldap specified
db_get libnss-ldapd/nsswitch
if [ -z "$RET" ]
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
# ask for which nsswitch options to configure
db_capb multiselect
db_input high libnss-ldapd/nsswitch || true
db_go || true
exit 0
|