rc.nftables 370 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # /etc/rc.d/rc.nftables
  3. # by ans for slackware14.2
  4. # ansenrod@cryptolab.net
  5. start(){
  6. /usr/sbin/nft -f /etc/nftables/nftables.conf
  7. echo "nftables inicialized"
  8. }
  9. stop(){
  10. /usr/sbin/nft flush ruleset
  11. echo "nftables stoped"
  12. }
  13. case "$1" in
  14. start)
  15. start
  16. ;;
  17. stop)
  18. stop
  19. ;;
  20. restart)
  21. stop
  22. sleep 1.5
  23. start
  24. ;;
  25. *)
  26. echo "Usage: $0 (start|stop|restart)"
  27. esac