summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Kemen <thepeople@openwrt.org>2008-03-18 03:16:32 +0000
committerTravis Kemen <thepeople@openwrt.org>2008-03-18 03:16:32 +0000
commit515e65dd5a917ee3350fee965f7a6873935c9172 (patch)
tree45d166c12760387e9df50c143fd261af298100d0
parentd650dae3a2e90c1dadc3e577c6e908f4384e956a (diff)
downloadmtk-20170518-515e65dd5a917ee3350fee965f7a6873935c9172.zip
mtk-20170518-515e65dd5a917ee3350fee965f7a6873935c9172.tar.gz
mtk-20170518-515e65dd5a917ee3350fee965f7a6873935c9172.tar.bz2
fix broken init file and some cleanup
SVN-Revision: 10613
-rw-r--r--package/admswconfig/files/admswconfig21
-rw-r--r--package/admswconfig/files/admswswitch.sh1
2 files changed, 14 insertions, 8 deletions
diff --git a/package/admswconfig/files/admswconfig b/package/admswconfig/files/admswconfig
index dd55242..d3a0565 100644
--- a/package/admswconfig/files/admswconfig
+++ b/package/admswconfig/files/admswconfig
@@ -8,30 +8,34 @@ start() {
mkdir -p /etc/config
-adm5120_detect() {
board_name=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
case "$board_name" in
"Compex WP54"*)
- board="WP54";;
+ board="Compex WP54";;
*)
;;
esac
-}
-adm5120_detect
+ echo "$board" |awk '
+ board=$1
+
+ function p(cfgname, name) {
+ if (c[name] != "") print " option " cfgname " \"" c[name] "\""
+ }
+
BEGIN {
FS="="
c["lan_ifname"]="eth0"
c["wan_ifname"]="eth1"
- c["eth0ports"]="12345"
+ c["eth0ports"]="1 2 3 4 5"
c["eth1ports"]="0"
}
END {
- if (model == "Compex WP54") {
- c["vlan0ports"]="0"
- c["vlan1ports"]="1"
+ if (board == "Compex WP54") {
+ c["eth0ports"]="0"
+ c["eth1ports"]="1"
}
print "#### VLAN configuration "
@@ -65,3 +69,4 @@ adm5120_detect
print " option proto dhcp"
}' > /etc/config/network
}
+
diff --git a/package/admswconfig/files/admswswitch.sh b/package/admswconfig/files/admswswitch.sh
index c5898d5..32a60a8 100644
--- a/package/admswconfig/files/admswswitch.sh
+++ b/package/admswconfig/files/admswswitch.sh
@@ -3,6 +3,7 @@
setup_switch_vlan() {
config_get ports "$CONFIG_SECTION" "eth$1"
+ ports=`echo "$ports"| sed s/" "/""/g`
admswconfig eth$1 ${ports}c
}