summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/meshwizard/files/usr
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2014-08-08 21:25:46 +0000
committerManuel Munz <freifunk@somakoma.de>2014-08-08 21:25:46 +0000
commit86503afdd9c35baa9c63ae1c838f228372269e93 (patch)
tree1a20a6db09f2d99b6e9d62508f4a3ffc12d26dd9 /contrib/package/meshwizard/files/usr
parent7c0b1137efbc1e60e74e9c351878c40fc0ac460c (diff)
contrib/meshwizard: add support for setting up qos on wan
Diffstat (limited to 'contrib/package/meshwizard/files/usr')
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh2
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_qos.sh17
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh6
3 files changed, 23 insertions, 2 deletions
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
index c5036631d4..cb0d319a2d 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
@@ -30,6 +30,6 @@ for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_
done
# read values from meshwizard
-for v in system luci_main contact community wan lan general ipv6; do
+for v in system luci_main contact community wan lan general ipv6 qos; do
get_var meshwizard.$v
done
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_qos.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_qos.sh
new file mode 100755
index 0000000000..25884b30d5
--- /dev/null
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_qos.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# sets up qos-scripts for the wan interface
+
+. /lib/functions.sh
+. $dir/functions.sh
+
+if [ ! -f /etc/config/qos ]; then
+ echo "NOT setting up QOS because /etc/config/qos-scripts was not found"
+else
+ uci batch <<- EOF
+ set qos.wan.enabled=1
+ set qos.wan.upload=$wan_up
+ set qos.wan.download=$wan_down
+ EOF
+ uci_commitverbose "Setup QOS on WAN interface." qos
+
+fi
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
index f7ee7cf9de..77c6cd95e9 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
@@ -12,7 +12,7 @@
. /lib/functions.sh
echo "
-/* Meshwizard 0.1.0 */
+/* Meshwizard 0.2.0 */
"
# config
@@ -71,6 +71,10 @@ if [ "$wan_proto" == "dhcp" ]; then
$dir/helpers/setup_wan_dhcp.sh
fi
+if [ -n "$wan_down" -a -n "$wan_up" ]; then
+ $dir/helpers/setup_qos.sh
+fi
+
if [ "$lan_proto" == "static" ] && [ -n "$lan_ip4addr" ] && [ -n "$lan_netmask" ]; then
$dir/helpers/setup_lan_static.sh
fi