-
Notifications
You must be signed in to change notification settings - Fork 3
/
bandwidthd
76 lines (57 loc) · 1.27 KB
/
bandwidthd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /bin/bash
#
# bandwidthd
#
# chkconfig: - 90 26
# description: Activates/Deactivates bandwidthd network traffic monitor
PROGNAME=/usr/sbin/bandwidthd
# Source function library.
. /etc/init.d/functions
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
if [ -f /etc/sysconfig/bandwidthd ]; then
. /etc/sysconfig/bandwidthd
fi
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# See how we were called.
case "$1" in
start)
#Register to dns
echo -n $"Starting Bandwidthd network traffic monitor: "
daemon $PROGNAME $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bandwidthd
exit $RETVAL
;;
stop)
echo -n $"Shuting down Bandwidthd network traffic monitor: "
killproc `basename $PROGNAME`
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bandwidthd
exit $RETVAL
;;
status)
status $PROGNAME
;;
condrestart)
if [ -f /var/lock/subsys/bandwidthd ]; then
$0 stop
$0 start
fi
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0