[packages] reaim: use network.sh to find devices
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:42:41 +0000 (15:42 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:42:41 +0000 (15:42 +0000)
SVN-Revision: 31950

net/reaim/Makefile
net/reaim/files/reaim.init

index 6c5c4abff2f70c5ff7e779a6759410638a04be9f..b3fa5d19c11ba306026ad7801d787a5d6970d5e1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=reaim
 PKG_VERSION:=0.8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/reaim
index 39c0cf8d970ddb4591a5bb66cabcbc1546375a7e..d848d9f9b13d3ea23a193fcc73744ca78aa4d75c 100644 (file)
@@ -1,20 +1,20 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 
 START=60
 
 IPT=/usr/sbin/iptables
 
 set_rules() {
-       include /lib/network
-       scan_interfaces
-       config_get WAN wan ifname
+       . /lib/functions/network.sh
 
-       [ -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
+       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() {