summaryrefslogtreecommitdiff
path: root/package/iptables/files/firewall.init
blob: b3ea698d6580f509ec5829effc3a9ed7efa16d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#PKG iptables
#INIT 45
. /etc/rc.conf

case $1 in
autostop) ;;
autostart)
	test x"${firewall:-NO}" = x"NO" && exit 0
	exec sh $0 start
	;;
start)
	. /etc/firewall.conf
	;;
stop)
	### Clear tables
	iptables -F
	iptables -X
	iptables -t nat -F
	iptables -t nat -X
	iptables -P INPUT ACCEPT
	iptables -P FORWARD ACCEPT
	iptables -P OUTPUT ACCEPT
	iptables -t nat -P PREROUTING ACCEPT
	iptables -t nat -P POSTROUTING ACCEPT
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	;;
esac
exit $?