]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/nscd
Add a missing ;.
[FreeBSD/FreeBSD.git] / etc / rc.d / nscd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: nscd
7 # REQUIRE: DAEMON
8 # BEFORE: LOGIN
9
10 #
11 # Add the following lines to /etc/rc.conf to enable nscd:
12 #
13 # nscd_enable="YES"
14 #
15 # See nscd(8) for flags
16 #
17
18 . /etc/rc.subr
19
20 name=nscd
21 rcvar=`set_rcvar`
22
23 command=/usr/sbin/nscd
24 extra_commands="flush"
25 flush_cmd="${command} -I all"
26
27 # usage: _nscd_set_option <option name> <default value>
28 #
29 _nscd_set_option() {
30         local _optname _defoptval _nscd_opt_val _cached_opt_val
31         _optname=$1
32         _defoptval=$2
33
34         _nscd_opt_val=$(eval "echo \$nscd_${_optname}")
35         _cached_opt_val=$(eval "echo \$cached_${_optname}")
36         
37         if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
38                 warn "You should use nscd_${_optname} instead of" \
39                     "cached_${_optname}"
40                 setvar "nscd_${_optname}" "$_cached_opt_val"
41         else
42                 setvar "nscd_${_optname}" "${_nscd_opt_val:-$_defoptval}"
43         fi
44 }
45
46
47 load_rc_config $name
48 _nscd_set_option "enable" "NO"
49 _nscd_set_option "pidfile" "/var/run/nscd.pid"
50 _nscd_set_option "flags" ""
51 run_rc_command "$1"
52