reaim.init 714 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. test x"$reaim" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  12. exec sh $0 start
  13. ;;
  14. start)
  15. $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
  16. $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
  17. $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
  18. $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
  19. /usr/sbin/reaim
  20. ;;
  21. stop)
  22. kill $(pgrep -f /usr/sbin/reaim)
  23. ;;
  24. restart)
  25. sh $0 stop
  26. sh $0 start
  27. ;;
  28. *)
  29. echo "Usage: $0 {start | stop | restart}"
  30. exit 1
  31. ;;
  32. esac
  33. exit $?