Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
pmacct
> pmacctd.init.rh
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File pmacctd.init.rh of Package pmacct (Revision 17)
Currently displaying revision
17
,
show latest
#!/bin/bash # # Init script for pmacct network monitoring tool. # # Original by Dag Wieers <dag@wieers.com>. # Modified for pmacct by Karl Latiss <karl.latiss@atvert.com.au>. # # chkconfig: 2345 13 86 # description: pmacct network monitoring tool. # # processname: pmacctd # config: /etc/pmacct/pmacctd.conf # pidfile: /var/run/pmacctd.pid source /etc/rc.d/init.d/functions [ -x /usr/sbin/pmacctd ] || exit 1 [ -r /etc/pmacct/pmacctd.conf ] || exit 1 ### Default variables CONFIG_FILE="/etc/pmacct/pmacctd.conf" RETVAL=0 prog="pmacctd" desc="pmacct network monitoring" start() { echo -n $"Starting $desc ($prog): " /usr/sbin/$prog -f "$CONFIG_FILE" RETVAL=$? if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog ; then echo_success echo else echo_failure echo fi } stop() { echo -n $"Shutting down $desc ($prog): " killproc $prog RETVAL=$? if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog ; then echo_success echo else echo_failure echo fi } reload() { echo -n $"Reloading $desc ($prog): " killproc $prog -HUP RETVAL=$? echo return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; condrestart) [ -e /var/lock/subsys/$prog ] && restart RETVAL=$? ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" RETVAL=1 esac exit $RETVAL