packages/net/reaim/files/reaim.init

27 lines
566 B
Plaintext
Raw Normal View History

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=60
IPT=/usr/sbin/iptables
set_rules() {
include /lib/network
scan_interfaces
config_get WAN wan ifname
[ -z "$WAN" ] && exit
$IPT $1 input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
$IPT $1 input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
$IPT $1 input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
$IPT $1 input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
}
start() {
service_start /usr/sbin/reaim && set_rules -A
}
stop() {
service_stop /usr/sbin/reaim && set_rules -D
}