projects
/
openwrt
/
staging
/
ldir.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c00b53f
)
netifd: implement find_config()
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 15 Mar 2012 09:49:26 +0000
(09:49 +0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 15 Mar 2012 09:49:26 +0000
(09:49 +0000)
SVN-Revision: 30947
package/netifd/files/lib/network/config.sh
patch
|
blob
|
history
diff --git
a/package/netifd/files/lib/network/config.sh
b/package/netifd/files/lib/network/config.sh
index 129cb66622f37447e6d30d2b707351b884bab4b8..8b91f96a6e85bfcfcce93822a1f54eee0b888c81 100755
(executable)
--- 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() {