updated on Tue Jan 17 00:10:10 UTC 2012
[aur-mirror.git] / firetable / rc.firetable
blob1743d09adfbf161cccef26ccc9a9d14753c4676c
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 # source application-specific settings
9 if [ -r /etc/firetable/firetable.conf ]; then
10 INTERFACES=`grep "^start_on_boot" /etc/firetable/firetable.conf | cut -f2 -d"="`
13 stat_busy "Starting Firetable"
14 /usr/sbin/firetable start ${INTERFACES} &> /dev/null
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon firetable
19 stat_done
22 stop)
23 stat_busy "Stopping Firetable"
24 /usr/sbin/firetable stop &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon iptables
29 stat_done
32 restart)
33 $0 stop
34 sleep 2
35 $0 start
37 save)
38 stat_busy "Saving Firetable configuration"
39 /usr/sbin/firetable flush &> /dev/null
40 if [ $? -gt 0 ]; then
41 stat_fail
42 else
43 stat_done
47 echo "usage: $0 {start|stop|restart|save}"
48 esac
49 exit 0