reaim.init 640 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. #PKG reaim
  3. #INIT 75
  4. . /etc/rc.conf
  5. IPT=/usr/sbin/iptables
  6. WAN=${reaim_flags}
  7. case $1 in
  8. autostop) ;;
  9. autostart)
  10. test x"${reaim:-NO}" = x"NO" && exit 0
  11. exec sh $0 start
  12. ;;
  13. start)
  14. $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
  15. $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
  16. $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
  17. $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
  18. /usr/sbin/reaim
  19. ;;
  20. stop)
  21. kill $(pgrep -f /usr/sbin/reaim)
  22. ;;
  23. restart)
  24. sh $0 stop
  25. sh $0 start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start | stop | restart}"
  29. exit 1
  30. ;;
  31. esac
  32. exit $?