File: init

package info (click to toggle)
ipac 0.99-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 180 kB
  • ctags: 64
  • sloc: perl: 878; ansic: 451; sh: 169; makefile: 69
file content (38 lines) | stat: -rw-r--r-- 639 bytes parent folder | download
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
#! /bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/ipacset
CONFIG=/etc/ipac.conf
PROC=/proc/net/ip_acct
IPFWADM=/sbin/ipfwadm

test -f $DAEMON && test -f $CONFIG && test -f $PROC && test -f $IPFWADM || exit 0

case "$1" in
  start)
	echo -n Configuring IP accounting...
	$DAEMON
	echo done.
    ;;
  stop)
	echo -n Stopping IP accounting...
	fetchipac
	ipfwadm -A -f
	echo done.
    ;;
  restart | force-reload)
	echo -n Restarting IP accounting...
	fetchipac
	ipfwadm -A -f
	$DAEMON
	echo done.
	;;
  reload)
	exit 1
	;;
  *)
    echo "Usage: /etc/init.d/ipac {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0