diff options
author | Christian Weisgerber <naddy@FreeBSD.org> | 2002-11-13 17:30:05 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@FreeBSD.org> | 2002-11-13 17:30:05 +0000 |
commit | 951e8c596f96b0b2ee06cbc6b04b053a336ed32e (patch) | |
tree | 75c954707db0c3aa40cf5558924a311b39f3cb34 /french/plgrenouille/files/plgrenouille.sh | |
parent | Add xapply 3.4, parallel Execution tool ala xargs/apply. (diff) |
Import plgrenouille 0.61.5.
Bandwidth measurement and statics collection tool for a French
project to this purpose.
PR: 41133
Submitted by: Cyrille Lefevre <cyrille.lefevre@laposte.net>
Diffstat (limited to '')
-rw-r--r-- | french/plgrenouille/files/plgrenouille.sh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/french/plgrenouille/files/plgrenouille.sh b/french/plgrenouille/files/plgrenouille.sh new file mode 100644 index 000000000000..4e458634cfc0 --- /dev/null +++ b/french/plgrenouille/files/plgrenouille.sh @@ -0,0 +1,59 @@ +#! /bin/sh +# +# $FreeBSD$ +# +# Start or stop portsentry. +# + +rc_file=${0##*/} +rc_arg=$1 + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then + echo "${rc_file}: Cannot determine PREFIX." >&2 + echo "Please use the complete pathname." >&2 + exit 64 +fi + +program_args=-b +program_dir=${PREFIX}/libexec +program_file=${rc_file%.sh} +program_path=${program_dir}/${program_file} + +pid_dir=/var/run +pid_file=${program_file}.pid +pid_path=${pid_dir}/${pid_file} + +syslog_facility=daemon.err + +case "$rc_arg" in +start) + if [ ! -x ${program_path} ]; then + logger -sp ${syslog_facility} -t ${program_file} \ + "unable to start: ${program_path} is missing." + exit 72 + fi + ${program_path} ${program_args} > /dev/null && + echo -n " ${program_file}" + ;; +stop) + if [ -r ${pid_path} ]; then + kill $(cat ${pid_path}) 2> /dev/null + else + killall ${program_file} 2> /dev/null + fi + ;; +restart) + $0 stop + $0 start + ;; +status) + ps auxww | egrep ${program_file} | egrep -v "($0|egrep)" + ;; +configure) + ${program_path} -c + ;; +*) + echo "usage: ${rc_file} {start|stop|restart|status}" >&2 + exit 64 + ;; +esac |