summaryrefslogtreecommitdiff
path: root/net/dictd/files/dictd.sh
diff options
context:
space:
mode:
authorClive Lin <clive@FreeBSD.org>2004-08-29 07:08:03 +0000
committerClive Lin <clive@FreeBSD.org>2004-08-29 07:08:03 +0000
commit3745885086fc28f30681b8b2d75506d6f7729c7c (patch)
tree9cbdc798c19fe10816f362554dcf8b693879d51c /net/dictd/files/dictd.sh
parentinkbox.h is specific to PX-G900. (diff)
+ Embrace rcNG. (1)
+ Only install default configuration file if it does not exist. (2) PR: ports/70390 (2) Submitted by: Andy Miller via MAINTAINER <dd at FreeBSD dot org> (1) Dryice Liu <dryice at liu dot com dot cn> (2) Approved by: MAINTAINER timeout.
Notes
Notes: svn path=/head/; revision=117550
Diffstat (limited to 'net/dictd/files/dictd.sh')
-rw-r--r--net/dictd/files/dictd.sh54
1 files changed, 15 insertions, 39 deletions
diff --git a/net/dictd/files/dictd.sh b/net/dictd/files/dictd.sh
index 42097ca39cc3..0e9bfb98eb51 100644
--- a/net/dictd/files/dictd.sh
+++ b/net/dictd/files/dictd.sh
@@ -1,44 +1,20 @@
#!/bin/sh
# $FreeBSD$
+#
+# PROVIDE: dictd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable dictd:
+#
+# dictd_enable="YES"
+#
-SOCKSTAT=/usr/bin/sockstat
-GREP=/usr/bin/grep
-AWK=/usr/bin/awk
-ECHO=/bin/echo
-CAT=/bin/cat
-KILL=/bin/kill
-RM=/bin/rm
+. /etc/rc.subr
-DICTD=%%PREFIX%%/sbin/dictd
+name=dictd
+rcvar=`set_rcvar`
+command=%%PREFIX%%/sbin/dictd
-# DICTD_OPTIONS="-put -command_line -options -for -dictd -here"
-DICTD_OPTIONS=""
-
-DICTD_PID_FILE=/var/run/dictd.pid
-
-case "$1" in
- start)
- if [ -x $DICTD ]; then
- ${ECHO} -n " dictd"
- $DICTD $DICTD_OPTIONS
- ${ECHO} `${SOCKSTAT} | ${GREP} dictd | ${AWK} '{print $3}'` > ${DICTD_PID_FILE}
- else
- ${ECHO} "dictd.sh: cannot find $DICTD or it's not executable"
- fi
- ;;
-
- stop)
- if [ ! -f $DICTD_PID_FILE ]; then
- exit 0
- fi
- dictdpid=`${CAT} $DICTD_PID_FILE`
- if [ "$dictdpid" -gt 0 ]; then
- ${ECHO} -n " dictd"
- ${KILL} -15 $dictdpid 2>&1 > /dev/null
- fi
- ${RM} -f $DICTD_PID_FILE
- ;;
- *)
- echo "Usage: dictd.sh { start | stop }"
- ;;
-esac
+load_rc_config $name
+run_rc_command "$1"