File: nslcd.if-up

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 (56 lines) | stat: -rw-r--r-- 1,819 bytes parent folder | download | duplicates (4)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

# /etc/network/if-up.d/nslcd script for signalling network changes
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA

NSLCD_NAME=nslcd
NSLCD_BIN=/usr/sbin/$NSLCD_NAME
NSLCD_CFG=/etc/nslcd.conf
NSLCD_CFG=/etc/nslcd.conf
NSLCD_STATEDIR=/var/run/nslcd
NSLCD_PIDFILE=$NSLCD_STATEDIR/nslcd.pid

# ignore lo interface
[ "$IFACE" = "lo" ] && exit 0

# only do things when starting the interface
[ "$MODE" != "start" ] && exit 0

# only care about IPv4 and IPv6 interfaces
[ "$ADDRFAM" != "inet" ] && [ "$ADDRFAM" != "inet6" ] && exit 0

# package must be installed
[ -x "$NSLCD_BIN" ] || exit 0
[ -f "$NSLCD_CFG" ] || exit 0

# daemon must be running
[ -f "$NSLCD_PIDFILE" ] || exit 0
"$NSLCD_BIN" --check || exit 0

# check daemon version (older versions terminate on SIGUSR1)
VERSION=$("$NSLCD_BIN" --version | sed -n 's/^nss-pam-ldapd \(0\.9\.[1-9][0-9]*\|0\.8\.1[4-9]\)/\1/p')
[ -n "$VERSION" ] || exit 0

# signal the daemon
. /lib/lsb/init-functions
log_action_begin_msg "Sending network state change signal to $NSLCD_NAME"
kill -s USR1 $(cat "$NSLCD_PIDFILE")
log_action_end_msg $?

exit 0