summaryrefslogtreecommitdiff
path: root/package/reaim/files/reaim.init
blob: dafe7caa6b14ae94069de37a22906c6376bfd7e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#PKG reaim
#INIT 75
. /etc/rc.conf

IPT=/usr/sbin/iptables
WAN=${reaim_flags}

case $1 in
autostop) ;;
autostart)
	test x"${reaim:-NO}" = x"NO" && exit 0
	test x"$reaim" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
	exec sh $0 start
	;;
start)
        $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
        $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
        $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
        $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
	/usr/sbin/reaim
	;;
stop)
	kill $(pgrep -f /usr/sbin/reaim)
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?