File: ipband.rc

package info (click to toggle)
ipband 0.8.1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 236 kB
  • ctags: 179
  • sloc: ansic: 1,679; sh: 117; makefile: 103
file content (56 lines) | stat: -rwxr-xr-x 870 bytes parent folder | download | duplicates (7)
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
#!/bin/sh
#
# ipband	This shell script takes care of starting and stopping
#		ipband.
#
# chkconfig: - 85 15
# description: ip bandwidth watchdog

# Source function library.
. /etc/init.d/functions

[ -f /etc/ipband.conf ] || exit 0

RETVAL=0
prog="ipband"

start() {
        echo -n $"Starting $prog: "
        daemon /usr/local/bin/ipband 
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipband
	return $RETVAL
}

stop() {
        echo -n $"Shutting down $prog: "
	killproc ipband
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipband
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
        ;;
  stop)
	stop
        ;;
  status)
	status ipband
	RETVAL=$?
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 1
esac