wshaper: minor fixes
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 11 Jun 2014 14:37:03 +0000 (16:37 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 11 Jun 2014 14:37:32 +0000 (16:37 +0200)
Adjust package version and release to reflect upstream compatibility,
replace deprecated uci_get_state with network_get_device.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
net/wshaper/Makefile
net/wshaper/files/wshaper.htb

index 2df68c6b409c3b83caf56d4878a2f3b5186d83c4..5007a87355d75d150ab9b2779c04c8888afb8b7e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wshaper
-PKG_VERSION:=0.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.1a
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
 
index 0729fb7107d995ed8acab42d1b1895d3ca9435e3..4b63eeeb5072316a7d0aedd9a6156a80d0ef760d 100755 (executable)
@@ -8,13 +8,18 @@
 # All config needs to be done in /etc/config/wshaper
 
 . /lib/functions.sh
+. /lib/functions/network.sh
+
 config_load wshaper
 for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do
        config_get $s settings $s
 done
 
-device=$(uci_get_state network "$network" ifname "$network")
-[ -z "$device" ] && logger -t wondershaper "Error: Could not find the device for network $network, aborting." && exit 1
+if ! network_get_device device "$network"; then
+       logger -t wondershaper "Error: Could not find the device for network $network, aborting."
+       exit 1
+fi
+
 [ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1
 [ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1