summaryrefslogtreecommitdiff
path: root/package/reaim/files/reaim.init
blob: 8ad5f87f0e8cceff5bc41610e72bca26e6f503bd (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
#!/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
	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 $?