[package] netifd: prevent error in ifup if no /etc/config/wireless exists, properly...
[openwrt.git] / package / netifd / files / sbin / ifup
index e17b67d..e6dbb35 100755 (executable)
@@ -50,16 +50,20 @@ else
        if_call "network.interface.$1"
 fi
 
-if [ -n "$setup_wifi" ] && grep -q config /etc/config/wireless; then
-       . /etc/functions.sh
+if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
+       . /lib/functions.sh
 
        find_related_radios() {
                local wdev wnet
                config_get wdev "$1" device
                config_get wnet "$1" network
 
-               if [ -n "$wdev" ] && [ "$wnet" = "$network" ]; then
-                       append radio_devs "$wdev" "$N"
+               if [ -n "$wdev" ]; then
+                       for wnet in $wnet; do
+                               if [ "$wnet" = "$network" ]; then
+                                       append radio_devs "$wdev" "$N"
+                               fi
+                       done
                fi
        }