X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/664467e66fa2c97a334ff7d4cd4392370a6d3abe..957731ef89fc1876a0ab8c56d50001011b20abb0:/package/netifd/files/lib/network/config.sh diff --git a/package/netifd/files/lib/network/config.sh b/package/netifd/files/lib/network/config.sh index 129cb6662..8fa9b1ac3 100755 --- a/package/netifd/files/lib/network/config.sh +++ b/package/netifd/files/lib/network/config.sh @@ -4,7 +4,21 @@ . /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 + json_get_var ifl3dev l3_device + if [[ "$device" = "$ifdev" ]] || [[ "$device" = "$ifl3dev" ]]; then + echo "$interface" + exit 0 + else + exit 1 + fi + ) && return + done } unbridge() {