From 11cdd8c18e72bf10191cbea26f5f3edccdd819f1 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 11 Nov 2006 12:57:23 +0000 Subject: move two functions from broadcom.sh to /sbin/wifi git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5496 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/default/sbin/wifi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'package/base-files') diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi index 67ccb8a0b..e13c3528a 100755 --- a/package/base-files/default/sbin/wifi +++ b/package/base-files/default/sbin/wifi @@ -3,6 +3,38 @@ . /etc/functions.sh +find_net_config() {( + local vif="$1" + local cfg + local ifname + + config_get cfg "$vif" network + + [ -z "$cfg" ] && { + include /lib/network + scan_interfaces + + config_get ifname "$vif" ifnamea + + cfg="$(find_config "$ifname")" + } + [ -z "$cfg" ] && return 0 + echo "$cfg" +)} + + +bridge_interface() {( + local cfg="$1" + [ -z "$cfg" ] && return 0 + + include /lib/network + scan_interfaces + + config_get iftype "$cfg" type + [ "$iftype" = bridge ] && config_get "$iftype" ifname +)} + + wifi_up() { for device in ${2:-$DEVICES}; do ( config_get iftype "$device" type -- cgit v1.2.3