aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-05-20 21:10:45 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-05-20 21:10:45 +0000
commitea65d5323a10c426749ab015926787ac89c77596 (patch)
tree2276f79e1491162603c0953fcb42bcd4f37786cb /package
parent6370a34c18a77990fa3af3893b38f912034c71e1 (diff)
downloadmaster-187ad058-ea65d5323a10c426749ab015926787ac89c77596.tar.gz
master-187ad058-ea65d5323a10c426749ab015926787ac89c77596.tar.bz2
master-187ad058-ea65d5323a10c426749ab015926787ac89c77596.zip
[PATCH] [qos-scripts] Reload modules with parameters specified
This patch makes qos-scripts reload a module when there is need to pass some parameters to it. It fixes an issue on devices with more than two interfaces where many IMQ devices are needed but the module is already loaded with the default numdevs=2 Signed-off-by: Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15945 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/qos-scripts/files/usr/lib/qos/generate.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/package/qos-scripts/files/usr/lib/qos/generate.sh b/package/qos-scripts/files/usr/lib/qos/generate.sh
index 6c52027a6a..94c01d4619 100755
--- a/package/qos-scripts/files/usr/lib/qos/generate.sh
+++ b/package/qos-scripts/files/usr/lib/qos/generate.sh
@@ -1,12 +1,21 @@
#!/bin/sh
[ -e /etc/functions.sh ] && . /etc/functions.sh || . ./functions.sh
-[ -x /sbin/modprobe ] && insmod="modprobe" || insmod="insmod"
+[ -x /sbin/modprobe ] && {
+ insmod="modprobe"
+ rmmod="$insmod -r"
+} || {
+ insmod="insmod"
+ rmmod="rmmod"
+}
add_insmod() {
eval "export isset=\${insmod_$1}"
case "$isset" in
1) ;;
- *) append INSMOD "$insmod $* >&- 2>&-" "$N"; export insmod_$1=1;;
+ *) {
+ [ "$2" ] && append INSMOD "$rmmod $1 >&- 2>&-" "$N"
+ append INSMOD "$insmod $* >&- 2>&-" "$N"; export insmod_$1=1
+ };;
esac
}