|
@@ -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
|
|