From 5101049296d63e06579e8cbd172ab47cd9df09c9 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Tue, 10 Jun 2008 19:28:06 +0000 Subject: Implmement rcNG. --- comms/conserver/files/conserver.sh.in | 43 ++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'comms/conserver/files/conserver.sh.in') diff --git a/comms/conserver/files/conserver.sh.in b/comms/conserver/files/conserver.sh.in index 0c40f10b61ef..3c4cc86c37ee 100644 --- a/comms/conserver/files/conserver.sh.in +++ b/comms/conserver/files/conserver.sh.in @@ -2,29 +2,40 @@ # $FreeBSD$ +# PROVIDE: conserver +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +# To enable conserver, add lines like below to /etc/rc.conf. +# +# conserver_enable="YES" + if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 + # echo "$0: Cannot determine the PREFIX" >&2 + # exit 1 fi +conserver_enable=${conserver_enable:-"no"} +conserver_configfile=${conserver_configfile:-"${PREFIX}/etc/conserver.cf"} + +. /etc/rc.subr + +name=conserver +rcvar=`set_rcvar` + +command=${PREFIX}/sbin/conserver +command_args="-d -n -C ${conserver_configfile}" + +load_rc_config $name + case "$1" in -start) - if [ -x ${PREFIX}/sbin/conserver -a -f ${PREFIX}/etc/conserver.cf ]; then - ${PREFIX}/sbin/conserver -d -n ; echo -n ' conserver' +start) if [ -x ${command} -a -f ${configfile} ]; then + run_rc_command "$1" fi ;; -stop) - killall -TERM conserver && echo -n ' conserver' - ;; -restart) - $0 stop - $0 start - ;; -status|stat) - ps -auxww | egrep '(conserver|console)' | egrep -v "($0|egrep)" - ;; *) - echo "Usage: `basename $0` {start|stop|restart|status}" >&2 + run_rc_command "$1" ;; esac -- cgit v1.2.3