summaryrefslogtreecommitdiff
path: root/net/openldap22/files/slurpd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net/openldap22/files/slurpd.sh')
-rw-r--r--net/openldap22/files/slurpd.sh64
1 files changed, 40 insertions, 24 deletions
diff --git a/net/openldap22/files/slurpd.sh b/net/openldap22/files/slurpd.sh
index 9f347253a5d6..fc9f88f21cd6 100644
--- a/net/openldap22/files/slurpd.sh
+++ b/net/openldap22/files/slurpd.sh
@@ -1,34 +1,50 @@
#!/bin/sh
#
# $FreeBSD$
+
+slurpd_program=%%PREFIX%%/libexec/slurpd
+
+slurpd_enable="NO"
+
+slurpd_args=
+
+# Add the following line to /etc/rc.conf to enable slurpd:
+#
+#slurpd_enable="YES"
+#
+# See slurpd(8) for details
#
-slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/ldap/slurpd.pid
+# Suck in the configuration variables.
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
-case "$1" in
-start)
- if [ -x $slurpd ]; then
- echo -n ' slurpd'
- $slurpd &
- echo $! > $pidfile
- fi
- ;;
-stop)
- pids=`ps xa | awk '/slurpd/{ print $1 }'`
- for pid in $pids; do
- kill $pid
- echo -n " slurpd($pid)"
- done
- ;;
-restart)
- $0 stop
- $0 start
- ;;
+case "$slurpd_enable" in
+[Yy][Ee][Ss])
+ case "$1" in
+ start)
+ if [ -x ${slurpd_program} ]; then
+ echo -n ' slurpd'
+ ${slurpd_program} ${slurpd_args}
+ fi
+ ;;
+ stop)
+ if ! killall `basename ${slurpd_program}`; then
+ echo ' slurpd: not running'
+ fi
+ ;;
+ *)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+ esac
+ ;;
*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
+ ;;
esac
exit 0