Standardize the rc.d script

This commit is contained in:
Doug Barton 2010-03-27 06:04:41 +00:00
parent 785a6d441d
commit 61dba4e9e5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251569
2 changed files with 17 additions and 42 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= netustad
PORTVERSION= 0.3.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= net-mgmt security
MASTER_SITES= http://www.enderunix.org/netustad/

View file

@ -1,53 +1,28 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: netustad
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Note:
# If you are running an rcNG-System (i.e. FreeBSD 5 and later or after
# having installed the rc_subr-port on an earlier system) you must set
# "netustad_enable=YES" in either /etc/rc.conf, /etc/rc.conf.local or
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# Please see netustad(8), rc.conf(5) and rc(8) for further details.
# netustad_enable (bool): Set to NO by default.
# Set it to YES to enable netustad.
. /etc/rc.subr
unset rcNG
name="netustad"
command=%%PREFIX%%/sbin/netustad
stop_cmd="killall ${name}"
rcvar=${name}_enable
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr && rcNG=yes
else
if [ -f %%PREFIX%%/etc/rc.subr ]; then
. %%PREFIX%%/etc/rc.subr && rcNG=yes
fi
fi
command=%%PREFIX%%/sbin/${name}
load_rc_config $name
: ${netustad="NO"}
run_rc_command "$1"
if [ "${rcNG}" ]; then
rcvar=`set_rcvar`
load_rc_config ${name}
run_rc_command "$1"
else
case $1 in
start)
if [ -x "${command}" ]; then
echo -n ' netustad '
${command}
fi
;;
stop)
if [ -x "${command}" ]; then
echo -n ' netustad '
${stop_cmd}
fi
;;
*)
echo "usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
exit 0
fi