3 # bandwidthd This shell script takes care of starting and stopping
6 # chkconfig: 2345 60 60
8 # description: BandwidthD tracks usage of TCP/IP network subnets and
9 # builds html files with graphs to display utilization.
11 # processname: bandwidthd
12 # config: /etc/bandwidthd.conf
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
22 [ -f /etc/sysconfig/bandwidthd ] && . /etc/sysconfig/bandwidthd
24 # Check that networking is up.
25 if is_yes "${NETWORKING}"; then
26 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
27 msg_network_down bandwidthd
35 [ -f /etc/bandwidthd.conf ] || exit 0
38 # See how we were called.
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/bandwidthd ]; then
43 msg_starting bandwidthd
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bandwidthd
48 msg_already_running "bandwidthd"
52 if [ -f /var/lock/subsys/bandwidthd ]; then
53 msg_stopping "bandwidthd"
55 rm -f /var/lock/subsys/bandwidthd >/dev/null 2>&1
57 msg_not_running "bandwidthd"
70 msg_usage "$0 {start|stop|restart|force-reload|status}"