diff options
author | Cy Schubert <cy@FreeBSD.org> | 2008-06-10 19:28:06 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2008-06-10 19:28:06 +0000 |
commit | 5101049296d63e06579e8cbd172ab47cd9df09c9 (patch) | |
tree | 7c1720523942558c4ac8b59fdc93b37dbe395a95 /comms/conserver/files/conserver.sh.in | |
parent | Update to DEV300_m18. (diff) |
Implmement rcNG.
Diffstat (limited to '')
-rw-r--r-- | comms/conserver/files/conserver.sh.in | 43 |
1 files changed, 27 insertions, 16 deletions
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 |