1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 01:33:10 +02:00

fix broken init file and some cleanup

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10613 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
thepeople 2008-03-18 03:16:32 +00:00
parent ba6e77ed2d
commit b5c0892412
2 changed files with 14 additions and 8 deletions

View File

@ -8,18 +8,22 @@ start() {
mkdir -p /etc/config mkdir -p /etc/config
adm5120_detect() {
board_name=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo) board_name=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
case "$board_name" in case "$board_name" in
"Compex WP54"*) "Compex WP54"*)
board="WP54";; board="Compex WP54";;
*) *)
;; ;;
esac esac
echo "$board" |awk '
board=$1
function p(cfgname, name) {
if (c[name] != "") print " option " cfgname " \"" c[name] "\""
} }
adm5120_detect
BEGIN { BEGIN {
FS="=" FS="="
c["lan_ifname"]="eth0" c["lan_ifname"]="eth0"
@ -29,9 +33,9 @@ adm5120_detect
} }
END { END {
if (model == "Compex WP54") { if (board == "Compex WP54") {
c["vlan0ports"]="0" c["eth0ports"]="0"
c["vlan1ports"]="1" c["eth1ports"]="1"
} }
print "#### VLAN configuration " print "#### VLAN configuration "
@ -65,3 +69,4 @@ adm5120_detect
print " option proto dhcp" print " option proto dhcp"
}' > /etc/config/network }' > /etc/config/network
} }

View File

@ -3,6 +3,7 @@
setup_switch_vlan() { setup_switch_vlan() {
config_get ports "$CONFIG_SECTION" "eth$1" config_get ports "$CONFIG_SECTION" "eth$1"
ports=`echo "$ports"| sed s/" "/""/g`
admswconfig eth$1 ${ports}c admswconfig eth$1 ${ports}c
} }