tuxmartin

firewall init skript

Jun 9th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. # cat /etc/init.d/firewall
  2. #! /bin/sh
  3. ### BEGIN INIT INFO
  4. # Provides:          firewall
  5. # Required-Start:    $network
  6. # Required-Stop:    
  7. # Default-Start:     2 3 4 5
  8. # Default-Stop:      0 1 6
  9. # Short-Description: Firewall
  10. # Description:       Firewall
  11. #                    :-)
  12. ### END INIT INFO
  13.  
  14. # Author: Martin Vancl <[email protected]>
  15. #
  16. # Do NOT "set -e"
  17.  
  18. # Load the VERBOSE setting and other rcS variables
  19. . /lib/init/vars.sh
  20.  
  21. # Define LSB log_* functions.
  22. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
  23. # and status_of_proc is working.
  24. . /lib/lsb/init-functions
  25.  
  26. do_start()
  27. {
  28.     /usr/local/bin/firewall.sh
  29.     service fail2ban restart
  30. }
  31.  
  32. do_status()
  33. {
  34.     echo -e "-------------------------------\nROUTE:\n"
  35.     route -n
  36.     echo -e "\n-------------------------------\nIPTABLES:\n"
  37.     iptables -L -n -v
  38. }
  39.  
  40. case "$1" in
  41.   start)
  42.     do_start
  43.     ;;
  44.   status)
  45.     do_status
  46.     ;;
  47.   *)
  48.     echo "Usage: $SCRIPTNAME {start|status}" >&2
  49.     exit 3
  50.     ;;
  51. esac
  52.  
  53. :
  54. root@eu:/media/data/home/spravce#
Advertisement
Add Comment
Please, Sign In to add comment