diff options
author | cy <cy@FreeBSD.org> | 2008-06-11 03:28:06 +0800 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2008-06-11 03:28:06 +0800 |
commit | 03c437ea0d3c64ca7c4dde47e1542bf413735da4 (patch) | |
tree | 95a54cf42f9a439a6e0d20d683a5db459376833c /comms/conserver | |
parent | e64d64aae1146127d21837c6bdba755d03e87f31 (diff) | |
download | freebsd-ports-gnome-03c437ea0d3c64ca7c4dde47e1542bf413735da4.tar.gz freebsd-ports-gnome-03c437ea0d3c64ca7c4dde47e1542bf413735da4.tar.zst freebsd-ports-gnome-03c437ea0d3c64ca7c4dde47e1542bf413735da4.zip |
Implmement rcNG.
Diffstat (limited to 'comms/conserver')
-rw-r--r-- | comms/conserver/Makefile | 2 | ||||
-rw-r--r-- | comms/conserver/files/conserver.sh | 43 | ||||
-rw-r--r-- | comms/conserver/files/conserver.sh.in | 43 |
3 files changed, 55 insertions, 33 deletions
diff --git a/comms/conserver/Makefile b/comms/conserver/Makefile index 0a2e495d8086..94d01f8fe727 100644 --- a/comms/conserver/Makefile +++ b/comms/conserver/Makefile @@ -8,7 +8,7 @@ PORTNAME= conserver PORTVERSION= 8.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= comms MASTER_SITES= ftp://ftp.physics.purdue.edu/pub/pundits/ \ http://www.komquats.com/distfiles/ \ diff --git a/comms/conserver/files/conserver.sh b/comms/conserver/files/conserver.sh index 0c40f10b61ef..3c4cc86c37ee 100644 --- a/comms/conserver/files/conserver.sh +++ b/comms/conserver/files/conserver.sh @@ -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 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 |