aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin/ifdown
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-07-22 00:21:20 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-07-22 00:21:20 +0000
commit365f76551af6786d9dda6cb20463a7c37321150e (patch)
tree25f5832c284adafd7141fc37f732bfa7cef5b756 /package/base-files/files/sbin/ifdown
parent90ac92e8bed28368f8af176092af9c9c3016f793 (diff)
downloadupstream-365f76551af6786d9dda6cb20463a7c37321150e.tar.gz
upstream-365f76551af6786d9dda6cb20463a7c37321150e.tar.bz2
upstream-365f76551af6786d9dda6cb20463a7c37321150e.zip
base-files: attempt bring up related wifi devices when calling ifup If a user invoked /sbin/ifup to bring up an interface, the setup used to fail in case of wireless networks tied to a non-bridged interface definition. Likewise, the bringup of "lan" in the default configuration will reinitialize the bridge but do not re-join the wireless network to it, requiring an extra call to /sbin/wifi (which might not be possible anymore due to a severed link if connected wirelessly).
The changeset modifies the "ifup" command to search for related wireless devices and call "wifi up" on them if applicable. This way the commands for wireless and non-wireless interfaces are unified from a cli point of view. The "ifup -a" case has not been changed to keep the logic of the /etc/init.d/network boot sequence. This might be changed later. Solves #9763. SVN-Revision: 27720
Diffstat (limited to 'package/base-files/files/sbin/ifdown')
-rwxr-xr-xpackage/base-files/files/sbin/ifdown22
1 files changed, 13 insertions, 9 deletions
diff --git a/package/base-files/files/sbin/ifdown b/package/base-files/files/sbin/ifdown
index 92cdfd2b02..1455a9de77 100755
--- a/package/base-files/files/sbin/ifdown
+++ b/package/base-files/files/sbin/ifdown
@@ -1,16 +1,20 @@
#!/bin/sh
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
. /etc/functions.sh
[ $# = 0 ] && { echo " $0 <group>"; exit; }
-[ "x$1" = "x-a" ] && {
- [ -e "/tmp/resolv.conf.auto" ] && rm /tmp/resolv.conf.auto
- config_cb() {
- [ interface != "$1" -o -z "$2" ] || eval "$0 $2"
- }
- config_load network
- exit
-}
+
+case "$1" in
+ "-a")
+ [ -e "/tmp/resolv.conf.auto" ] && rm /tmp/resolv.conf.auto
+ config_cb() {
+ [ interface != "$1" -o -z "$2" ] || eval "$0 -w $2"
+ }
+ config_load network
+ exit 0
+ ;;
+ "-w") shift ;;
+esac
include /lib/network
scan_interfaces