freewrt_1_0
freewrt_2_0
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | . /etc/rc.conf
|
|---|
| 4 |
|
|---|
| 5 | case $1 in
|
|---|
| 6 | autostart)
|
|---|
| 7 | test x"${firewall:-NO}" = x"NO" && exit 0
|
|---|
| 8 | exec $0 start
|
|---|
| 9 | ;;
|
|---|
| 10 | start)
|
|---|
| 11 | . /etc/firewall.conf
|
|---|
| 12 | ;;
|
|---|
| 13 | stop)
|
|---|
| 14 | ### Clear tables
|
|---|
| 15 | iptables -F
|
|---|
| 16 | iptables -X
|
|---|
| 17 | iptables -t nat -F
|
|---|
| 18 | iptables -t nat -X
|
|---|
| 19 | iptables -P INPUT ACCEPT
|
|---|
| 20 | iptables -P FORWARD ACCEPT
|
|---|
| 21 | iptables -P OUTPUT ACCEPT
|
|---|
| 22 | iptables -t nat -P PREROUTING ACCEPT
|
|---|
| 23 | iptables -t nat -P POSTROUTING ACCEPT
|
|---|
| 24 | ;;
|
|---|
| 25 | restart)
|
|---|
| 26 | $0 stop
|
|---|
| 27 | $0 start
|
|---|
| 28 | ;;
|
|---|
| 29 | *)
|
|---|
| 30 | echo "Usage: $0 {start | stop | restart}"
|
|---|
| 31 | ;;
|
|---|
| 32 | esac
|
|---|
| 33 | exit $?
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.