base-files: add a protocol argument to ucidef_set_interface_raw
authorFlorian Fainelli <florian@openwrt.org>
Thu, 25 Sep 2014 19:08:56 +0000 (19:08 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 25 Sep 2014 19:08:56 +0000 (19:08 +0000)
Add a third argument to ucidef_set_interface_raw, which is specifying
the protocol.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 42665

package/base-files/files/lib/functions/uci-defaults.sh

index f144adefb4d8b70f47fd6a770667b70c12a2ac02..e90090c40b0fe8e5605254fd01e6b279c3ef36f2 100644 (file)
@@ -158,11 +158,12 @@ EOF
 ucidef_set_interface_raw() {
        local cfg=$1
        local ifname=$2
+       local proto=${3:-"none"}
 
        uci batch <<EOF
 set network.$cfg='interface'
 set network.$cfg.ifname='$ifname'
-set network.$cfg.proto='none'
+set network.$cfg.proto='$proto'
 EOF
 }