]> git.pld-linux.org Git - packages/bandwidthd.git/blame - bandwidthd.init
- tabs in preamble
[packages/bandwidthd.git] / bandwidthd.init
CommitLineData
9da4db9f 1#!/bin/sh
2#
3# bandwidthd This shell script takes care of starting and stopping
4# bandwidthd.
5#
6# chkconfig: 2345 60 60
7#
8618c3ad 8# description: BandwidthD tracks usage of TCP/IP network subnets and
9da4db9f 9# builds html files with graphs to display utilization.
10#
11# processname: bandwidthd
12# config: /etc/bandwidthd.conf
13
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18# Get network config
19. /etc/sysconfig/network
20
21# Get service config
22[ -f /etc/sysconfig/bandwidthd ] && . /etc/sysconfig/bandwidthd
23
24# Check that networking is up.
25if is_yes "${NETWORKING}"; then
26 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
27 msg_network_down bandwidthd
28 exit 1
29 fi
30else
31 exit 0
32fi
33
34# Sanity check
35[ -f /etc/bandwidthd.conf ] || exit 0
36
37RETVAL=0
38# See how we were called.
39case "$1" in
40 start)
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/bandwidthd ]; then
43 msg_starting bandwidthd
44 daemon bandwidthd
45 RETVAL=$?
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bandwidthd
47 else
48 msg_already_running "bandwidthd"
49 fi
50 ;;
51 stop)
52 if [ -f /var/lock/subsys/bandwidthd ]; then
53 msg_stopping "bandwidthd"
54 killproc bandwidthd
55 rm -f /var/lock/subsys/bandwidthd >/dev/null 2>&1
56 else
57 msg_not_running "bandwidthd"
58 fi
59 ;;
60 status)
61 status bandwidthd
62 exit $?
63 ;;
64 restart|force-reload)
65 $0 stop
66 $0 start
67 exit $?
68 ;;
69 *)
70 msg_usage "$0 {start|stop|restart|force-reload|status}"
71 exit 3
72esac
73
74exit $RETVAL
This page took 0.172044 seconds and 4 git commands to generate.