projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[package] base-files: add ucidef_add_switch_port function
[openwrt.git]
/
package
/
base-files
/
files
/
lib
/
functions
/
uci-defaults.sh
diff --git
a/package/base-files/files/lib/functions/uci-defaults.sh
b/package/base-files/files/lib/functions/uci-defaults.sh
index bf6fe1e3057245c4825c2c49138cebc36a39c544..da2093bbb7bf44b687d513b577f16f56980b690e 100644
(file)
--- a/
package/base-files/files/lib/functions/uci-defaults.sh
+++ b/
package/base-files/files/lib/functions/uci-defaults.sh
@@
-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
+}
+