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 /package/netifd | |
parent | c00b53f3d0ba7ce36f094fba9e6145e3480457ed (diff) | |
download | mtk-20170518-adff0183cad1a7d405bcf20c12d04efb6adf5c71.zip mtk-20170518-adff0183cad1a7d405bcf20c12d04efb6adf5c71.tar.gz mtk-20170518-adff0183cad1a7d405bcf20c12d04efb6adf5c71.tar.bz2 |
netifd: implement find_config()
SVN-Revision: 30947
Diffstat (limited to 'package/netifd')
-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 129cb66..8b91f96 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() { |