[package] base-files: add ucidef_add_switch_port function
authorluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 23 Jan 2014 11:33:41 +0000 (11:33 +0000)
committerluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 23 Jan 2014 11:33:41 +0000 (11:33 +0000)
Signed-off-by: Luka Perkov <luka@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39372 3c298f89-4303-0410-b956-a3cf2f4a3e73

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

index d6c5938..33c0c5b 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=150
+PKG_RELEASE:=151
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index bf6fe1e..da2093b 100644 (file)
@@ -234,3 +234,13 @@ set network.@switch_vlan[-1].ports='$ports'
 EOF
 }
 
+ucidef_add_switch_port() {
+       local device=$1
+       local port=$2
+       uci batch <<EOF
+add network switch_port
+set network.@switch_port[-1].device='$device'
+set network.@switch_port[-1].port='$port'
+EOF
+}
+