]> TLD Linux GIT Repositories - packages/shorewall.git/blob - shorewall.init
- based on PLD spec, version 5.2.0.4 for TLD, not tested, release 0.1
[packages/shorewall.git] / shorewall.init
1 #!/bin/sh
2 #
3 # shorewall             The Shoreline Firewall (Shorewall) Packet Filtering Firewall
4 #
5 # chkconfig:    2345 10 89
6 #
7 # description: Packet filtering firewall
8 #
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12 . /usr/share/shorewall/functions
13
14 # Get network config
15 . /etc/sysconfig/network
16
17 # Check that networking is up
18 if is_yes "${NETWORKING}"; then
19         if [ ! -f /var/lock/subsys/network ]; then
20                 msg_network_down shorewall
21                 exit 1
22         fi
23 else
24         exit 0
25 fi
26
27 start() {
28         if [ -f /var/lock/subsys/shorewall ]; then
29                 msg_already_running shorewall
30                 return
31         fi
32
33         msg_starting "Shorewall"
34         deltext; ok
35         # FIXME: use daemon and handle OK/FAIL
36         exec /sbin/shorewall -q start >/dev/null
37         touch /var/lock/subsys/shorewall
38 }
39
40 stop() {
41         if [ ! -f /var/lock/subsys/shorewall ]; then
42                 msg_not_running shorewall
43                 return
44         fi
45
46         msg_stopping "Shorewall"
47         deltext; ok
48         # FIXME: use killproc or handle OK/FAIL manually
49         exec /sbin/shorewall stop >/dev/null
50         rm -f /var/lock/subsys/shorewall >/dev/null 2>&1
51 }
52
53 # See how we were called
54 case "$1" in
55   start)
56         ;;
57   stop)
58         ;;
59   status)
60         status shorewall
61         exec /sbin/shorewall status
62         exit $?
63         ;;
64   restart)
65         stop
66         start
67         ;;
68   *)
69         msg_usage "$0 {start|stop|restart|status}"
70         exit 3
71 esac