summaryrefslogtreecommitdiff
path: root/package/iptables/files/firewall.init
blob: 29fed932324db204bdac144bfbfcad8ff2c4c37e (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
36
#!/bin/sh
#PKG iptables
#INIT 45
. /etc/rc.conf

case $1 in
autostop) ;;
autostart)
	test x"${firewall:-NO}" = x"NO" && exit 0
	test x"$firewall" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
	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 $?