firewall6.init 505 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. #PKG ip6tables
  3. #INIT 45
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${firewall6:-NO}" = x"NO" && exit 0
  9. test x"$firewall6" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. . /etc/firewall6.conf
  14. ;;
  15. stop)
  16. ### Clear tables
  17. ip6tables -F
  18. ip6tables -X
  19. ip6tables -P INPUT ACCEPT
  20. ip6tables -P FORWARD ACCEPT
  21. ip6tables -P OUTPUT ACCEPT
  22. ;;
  23. restart)
  24. sh $0 stop
  25. sh $0 start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start | stop | restart}"
  29. ;;
  30. esac
  31. exit $?