add support for static routes - based on the patch from #1365
[openwrt/openwrt.git] / package / base-files / files / etc / functions.sh
index 931f4be472d01a799b690a917570d323f3488471..1cb365d478d6ffcececf9568f3c58cc84abc54f8 100755 (executable)
@@ -125,10 +125,13 @@ config_set() {
 
 config_foreach() {
        local function="$1"
-       local section
+       local type="$2"
+       local section cfgtype
        
        [ -z "$CONFIG_SECTIONS" ] && return 0
        for section in ${CONFIG_SECTIONS}; do
+               config_get cfgtype "$section" TYPE
+               [ -n "$type" -a "$cfgtype" != "$type" ] && continue
                eval "$function \"\$section\""
        done
 }