File: nslcd.postrm

package info (click to toggle)
nss-pam-ldapd 0.9.10-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 4,768 kB
  • sloc: ansic: 16,287; sh: 6,589; python: 3,368; xml: 1,925; makefile: 294; exp: 146
file content (37 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
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

CONFFILE="/etc/nslcd.conf"
OCONFFILE="/etc/nss-ldapd.conf"

# taken Developer's Reference 6.4
pathfind() {
  OLDIFS="$IFS"
  IFS=:
  for p in $PATH; do
    if [ -x "$p/$*" ]; then
      IFS="$OLDIFS"
      return 0
    fi
  done
  IFS="$OLDIFS"
  return 1
}

# remove /var/run/nslcd directory on remove unless an nslcd implementation
# is still installed (e.g. when switching between nslcd and pynslcd)
if [ "$1" = "remove" ] && ! pathfind nslcd && ! pathfind pynslcd
then
  rm -rf /var/run/nslcd
fi

# remove our configuration file (not a conffile) on purge unless an nslcd
# implementation is still installed (e.g. when switching between nslcd and
# pynslcd)
if [ "$1" = "purge" ] && ! pathfind nslcd && ! pathfind pynslcd
then
  rm -f "$CONFFILE" "$OCONFFILE"
fi

#DEBHELPER#