packages/net/reaim/files/reaim.init
jow 332bf9532e [packages] reaim: use network.sh to find devices
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31950 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-05-28 15:42:41 +00:00

27 lines
575 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2012 OpenWrt.org
START=60
IPT=/usr/sbin/iptables
set_rules() {
. /lib/functions/network.sh
local device
network_get_device device wan && {
$IPT $1 input_rule -i $device -p tcp --dport 1863:1864 -j ACCEPT
$IPT $1 input_rule -i $device -p tcp --dport 4443 -j ACCEPT
$IPT $1 input_rule -i $device -p tcp --dport 5566 -j ACCEPT
$IPT $1 input_rule -i $device -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
}