updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / gshield / gshield.init
blobdfe3845935c1942cba8c4211c9ee9e38899bf35a
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 # Check that networking is up
7 if ck_daemon network; then
8 echo "Cannot run gshield without network -run network first"
9 exit
12 start() {
13 stat_busy "Loading gShield network firewall"
14 /usr/share/gshield/gShield.rc start > /dev/null
15 # check that it loaded
16 iptables -L DMZ > /dev/null 2>&1
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 stat_done
24 stop() {
25 stat_busy "Unloading gShield network firewall"
26 /usr/share/gshield/gShield.rc stop > /dev/null
27 # check that it unloaded
28 if iptables -L DMZ > /dev/null 2>&1 ; then
29 stat_fail
30 else
31 stat_done
35 case $1 in
36 start)
37 start
39 stop)
40 stop
42 restart)
43 stop
44 sleep 1
45 start
48 echo "Usage: gshield {start|stop|restart}"
49 exit 1
50 esac