aboutsummaryrefslogtreecommitdiffstats
path: root/package/netifd/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-15 09:49:26 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-03-15 09:49:26 +0000
commite6721f01b5143d083bad5ef77388d209600b98fd (patch)
treeca2bb1a2d86baabcdb1ac13db2b1af24ee77d4c9 /package/netifd/files
parent6189648864db8ae11feb600fc53ac2fee556707d (diff)
downloadupstream-e6721f01b5143d083bad5ef77388d209600b98fd.tar.gz
upstream-e6721f01b5143d083bad5ef77388d209600b98fd.tar.bz2
upstream-e6721f01b5143d083bad5ef77388d209600b98fd.zip
netifd: implement find_config()
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30947 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/netifd/files')
-rwxr-xr-xpackage/netifd/files/lib/network/config.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/package/netifd/files/lib/network/config.sh b/package/netifd/files/lib/network/config.sh
index 129cb66622..8b91f96a6e 100755
--- a/package/netifd/files/lib/network/config.sh
+++ b/package/netifd/files/lib/network/config.sh
@@ -4,7 +4,20 @@
. /usr/share/libubox/jshn.sh
find_config() {
- return
+ local device="$1"
+ for ifobj in `ubus list network.interface.\*`; do
+ interface="${ifobj##network.interface.}"
+ (
+ json_load "$(ifstatus $interface)"
+ json_get_var ifdev device
+ if [[ "$device" = "$ifdev" ]]; then
+ echo "$interface"
+ exit 0
+ else
+ exit 1
+ fi
+ ) && return
+ done
}
unbridge() {