]>
Commit | Line | Data |
---|---|---|
425f19f7 | 1 | #!/bin/sh |
2 | # | |
3 | # firestarter Firestarter firewall. | |
4 | # | |
5 | # chkconfig: 2345 11 89 | |
6 | # | |
7 | # description: Starts and stops FireStarter, an easy-to-use, | |
8 | # yet powerful, Linux firewall tool for GNOME. | |
9 | # | |
10 | # $Id$ | |
11 | ||
12 | ||
13 | # Source function library | |
14 | . /etc/rc.d/init.d/functions | |
15 | ||
16 | # Get network config | |
17 | . /etc/sysconfig/network | |
18 | ||
19 | FS_CONTROL="/etc/firestarter/firestarter.sh" | |
20 | ||
21 | # Check that networking is up. | |
22 | if is_yes "${NETWORKING}"; then | |
23 | if [ ! -f /var/lock/subsys/network ]; then | |
24 | msg_network_down firestarter | |
25 | exit 1 | |
26 | fi | |
27 | else | |
28 | exit 0 | |
29 | fi | |
30 | ||
31 | ||
32 | # See how we were called. | |
33 | case "$1" in | |
34 | start) | |
35 | # Check if the service is already running? | |
36 | if [ ! -f /var/lock/subsys/firestarter ]; then | |
37 | msg_starting firestarter | |
38 | busy | |
39 | $FS_CONTROL start > /dev/null | |
40 | RETVAL=$? | |
41 | if [ $RETVAL -eq 0 ]; then | |
42 | touch /var/lock/subsys/firestarter | |
43 | ok | |
44 | else | |
45 | fail | |
46 | fi | |
47 | else | |
48 | msg_already_running firestarter | |
49 | fi | |
50 | ;; | |
51 | stop) | |
52 | if [ -f /var/lock/subsys/firestarter ]; then | |
53 | msg_stopping firestarter | |
54 | busy | |
55 | $FS_CONTROL stop > /dev/null | |
56 | rm -f /var/lock/subsys/firestarter | |
57 | ok | |
58 | else | |
59 | msg_not_running firestarter | |
60 | fi | |
61 | ;; | |
62 | restart) | |
63 | $0 stop | |
64 | $0 start | |
65 | exit $? | |
66 | ;; | |
67 | reload) | |
68 | if [ -f /var/lock/subsys/firestarter ]; then | |
69 | msg_reloading firestarter | |
70 | busy | |
71 | $FS_CONTROL stop > /dev/null | |
72 | RETVAL=$? | |
73 | if [ ! $RETVAL -eq 0 ]; then | |
74 | fail | |
75 | exit $RETVAL | |
76 | fi | |
77 | $FS_CONTROL start > /dev/null | |
78 | RETVAL=$? | |
79 | if [ ! $RETVAL -eq 0 ]; then | |
80 | fail | |
81 | exit $RETVAL | |
82 | fi | |
83 | ok | |
84 | else | |
85 | # show "%s service is not running." firestarter | |
86 | msg_not_running firestarter >&2 | |
87 | RETVAL=7 | |
88 | fi | |
89 | ;; | |
90 | force-reload) | |
91 | # if program allows reloading without stopping | |
92 | $0 reload | |
93 | ||
94 | # or if it doesn't | |
95 | $0 restart | |
96 | ||
97 | exit $? | |
98 | ;; | |
99 | status) | |
100 | status firestarter | |
101 | RETVAL=$? | |
102 | ;; | |
103 | *) | |
104 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" | |
105 | exit 3 | |
106 | esac | |
107 | ||
108 | exit $RETVAL | |
109 | ||
110 | # This must be last line ! | |
111 | # vi:syntax=sh:tw=78:ts=8:sw=4 |