mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
Standardize the rc.d script
This commit is contained in:
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
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= netustad
|
PORTNAME= netustad
|
||||||
PORTVERSION= 0.3.1
|
PORTVERSION= 0.3.1
|
||||||
PORTREVISION= 3
|
PORTREVISION= 4
|
||||||
CATEGORIES= net-mgmt security
|
CATEGORIES= net-mgmt security
|
||||||
MASTER_SITES= http://www.enderunix.org/netustad/
|
MASTER_SITES= http://www.enderunix.org/netustad/
|
||||||
|
|
||||||
|
|
|
@ -1,53 +1,28 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
#
|
#
|
||||||
# PROVIDE: netustad
|
# PROVIDE: netustad
|
||||||
# REQUIRE: NETWORKING SERVERS
|
# REQUIRE: NETWORKING SERVERS
|
||||||
# BEFORE: DAEMON
|
# BEFORE: DAEMON
|
||||||
|
# KEYWORD: shutdown
|
||||||
#
|
#
|
||||||
# Note:
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
||||||
# If you are running an rcNG-System (i.e. FreeBSD 5 and later or after
|
# to enable this service:
|
||||||
# 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
|
|
||||||
#
|
#
|
||||||
# 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"
|
name="netustad"
|
||||||
command=%%PREFIX%%/sbin/netustad
|
rcvar=${name}_enable
|
||||||
stop_cmd="killall ${name}"
|
|
||||||
|
|
||||||
if [ -f /etc/rc.subr ]; then
|
command=%%PREFIX%%/sbin/${name}
|
||||||
. /etc/rc.subr && rcNG=yes
|
|
||||||
else
|
load_rc_config $name
|
||||||
if [ -f %%PREFIX%%/etc/rc.subr ]; then
|
|
||||||
. %%PREFIX%%/etc/rc.subr && rcNG=yes
|
: ${netustad="NO"}
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${rcNG}" ]; then
|
|
||||||
rcvar=`set_rcvar`
|
|
||||||
load_rc_config ${name}
|
|
||||||
run_rc_command "$1"
|
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
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue