]> git.pld-linux.org Git - packages/firestarter.git/blob - firestarter.init
- updated gettext BR
[packages/firestarter.git] / firestarter.init
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 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 FS_CONTROL=/etc/firestarter/firestarter.sh
19
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23                 msg_network_down "firestarter"
24                 exit 1
25         fi
26 else
27         exit 0
28 fi
29
30 start() {
31         # Check if the service is already running?
32         if [ -f /var/lock/subsys/firestarter ]; then
33                 msg_already_running "firestarter"
34                 return
35         fi
36
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 }
48
49 stop() {
50         if [ ! -f /var/lock/subsys/firestarter ]; then
51                 msg_not_running "firestarter"
52                 return
53         fi
54
55         msg_stopping "firestarter"
56         busy
57         $FS_CONTROL stop > /dev/null
58         rm -f /var/lock/subsys/firestarter
59         ok
60 }
61
62 condrestart() {
63         if [ ! -f /var/lock/subsys/firestarter ]; then
64                 msg_not_running "firestarter"
65                 RETVAL=$1
66                 return
67         fi
68
69         stop
70         start
71 }
72
73 # See how we were called.
74 case "$1" in
75   start)
76         start
77         ;;
78   stop)
79         stop
80         ;;
81   restart)
82         stop
83         start
84         ;;
85   try-restart)
86         condrestart 0
87         ;;
88   force-reload)
89         condrestart 7
90         ;;
91   status)
92         status firestarter
93         RETVAL=$?
94         ;;
95   *)
96         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
97         exit 3
98 esac
99
100 exit $RETVAL
This page took 0.064378 seconds and 3 git commands to generate.