PXE init script
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          pxe-boot
  4. # Should-Start:      console-screen
  5. # Required-Start:    $network $local_fs
  6. # Required-Stop:     $network $local_fs
  7. # Default-Start:     2 3 4 5
  8. # Default-Stop:      0 1 6
  9. # Short-Description: pxe-boot
  10. # Description:       pxe-boot
  11. ### END INIT INFO
  12. set -e
  13.  
  14. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  15.  
  16. . /lib/lsb/init-functions
  17.  
  18. case "$1" in
  19.   start)
  20. #maskarada
  21. beep -f 1000 -l 150
  22. iptables -A FORWARD -i eth0 -o eth1 -s 192.168.1.0/24 -m state --state NEW -j ACCEPT
  23. iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
  24. iptables -A POSTROUTING -t nat -j MASQUERADE
  25. sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
  26.  
  27. #iptables
  28. iptables -t filter -A INPUT -i eth0 -s foo.bar.0/24 -j ACCEPT
  29. iptables -t filter -A INPUT -p icmp -j ACCEPT
  30. iptables -t filter -A OUTPUT -p icmp -j ACCEPT
  31.  
  32. #vypnout blanking
  33. setterm -powersave off 2> /dev/null
  34. setterm -powerdown 0
  35. setterm -blank 0
  36. sleep 5s
  37. beep -f 2000 -l 1500
  38. echo ""
  39. echo "PXE Boot Server is up and running"
  40. echo ""
  41. ;;
  42.  
  43.   restart|reload|force-reload)
  44. /etc/init.d/pxe-server stop 1> /dev/null
  45. /etc/init.d/pxe-server start 1> /dev/null
  46. ;;
  47.  
  48.   stop)
  49. iptables -F
  50. beep -f 1000 -l 800
  51.   ;;
  52.  
  53. *)
  54. echo "Usage: $0 {start|restart|stop}"
  55. esac
  56.  
  57. exit 0
  58.  
Parsed in 0.008 seconds