Browse Source

wshaper: minor fixes

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>
Jo-Philipp Wich 10 years ago
parent
commit
6b2f1d0047
2 changed files with 10 additions and 5 deletions
  1. 3
    3
      net/wshaper/Makefile
  2. 7
    2
      net/wshaper/files/wshaper.htb

+ 3
- 3
net/wshaper/Makefile View File

1
 #
1
 #
2
-# Copyright (C) 2007-2011 OpenWrt.org
2
+# Copyright (C) 2007-2014 OpenWrt.org
3
 #
3
 #
4
 # This is free software, licensed under the GNU General Public License v2.
4
 # This is free software, licensed under the GNU General Public License v2.
5
 # See /LICENSE for more information.
5
 # See /LICENSE for more information.
8
 include $(TOPDIR)/rules.mk
8
 include $(TOPDIR)/rules.mk
9
 
9
 
10
 PKG_NAME:=wshaper
10
 PKG_NAME:=wshaper
11
-PKG_VERSION:=0.2
12
-PKG_RELEASE:=2
11
+PKG_VERSION:=1.1a
12
+PKG_RELEASE:=1
13
 
13
 
14
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
14
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
15
 
15
 

+ 7
- 2
net/wshaper/files/wshaper.htb View File

8
 # All config needs to be done in /etc/config/wshaper
8
 # All config needs to be done in /etc/config/wshaper
9
 
9
 
10
 . /lib/functions.sh
10
 . /lib/functions.sh
11
+. /lib/functions/network.sh
12
+
11
 config_load wshaper
13
 config_load wshaper
12
 for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do
14
 for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do
13
 	config_get $s settings $s
15
 	config_get $s settings $s
14
 done
16
 done
15
 
17
 
16
-device=$(uci_get_state network "$network" ifname "$network")
17
-[ -z "$device" ] && logger -t wondershaper "Error: Could not find the device for network $network, aborting." && exit 1
18
+if ! network_get_device device "$network"; then
19
+	logger -t wondershaper "Error: Could not find the device for network $network, aborting."
20
+	exit 1
21
+fi
22
+
18
 [ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1
23
 [ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1
19
 [ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1
24
 [ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1
20
 
25