diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-15 09:49:26 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-03-15 09:49:26 +0000 |
commit | adff0183cad1a7d405bcf20c12d04efb6adf5c71 (patch) | |
tree | dd26bf5b34f98582226d1dfb375a121f579be9f3 | |
parent | c00b53f3d0ba7ce36f094fba9e6145e3480457ed (diff) | |
download | upstream-adff0183cad1a7d405bcf20c12d04efb6adf5c71.tar.gz upstream-adff0183cad1a7d405bcf20c12d04efb6adf5c71.tar.bz2 upstream-adff0183cad1a7d405bcf20c12d04efb6adf5c71.zip |
netifd: implement find_config()
SVN-Revision: 30947
-rwxr-xr-x | package/netifd/files/lib/network/config.sh | 15 |
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() { |