Переглянути джерело

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 роки тому
джерело
коміт
6b2f1d0047
2 змінених файлів з 10 додано та 5 видалено
  1. 3
    3
      net/wshaper/Makefile
  2. 7
    2
      net/wshaper/files/wshaper.htb

+ 3
- 3
net/wshaper/Makefile Переглянути файл

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2007-2011 OpenWrt.org
2
+# Copyright (C) 2007-2014 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -8,8 +8,8 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 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 14
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
15 15
 

+ 7
- 2
net/wshaper/files/wshaper.htb Переглянути файл

@@ -8,13 +8,18 @@
8 8
 # All config needs to be done in /etc/config/wshaper
9 9
 
10 10
 . /lib/functions.sh
11
+. /lib/functions/network.sh
12
+
11 13
 config_load wshaper
12 14
 for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do
13 15
 	config_get $s settings $s
14 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 23
 [ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1
19 24
 [ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1
20 25