1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 [ -e /etc
/config
/network
] && exit 0
12 if grep -E 'mtd0: 000(6|a)0000' /proc
/mtd
2>&- >&-; then
14 echo boardtype
=wgt634u
16 strings /dev
/mtdblock
/3
19 function p(cfgname, name) {
20 if (c[name] != "") print " option " cfgname " \"" c[name] "\""
25 c["lan_ifname"]="eth0.0"
26 c["wan_ifname"]="eth0.1"
27 c["vlan0ports"]="1 2 3 4 5*"
31 ($1 == "boardnum") || ($1 == "boardtype") || ($1 == "boardflags") {
37 if (nvram["boardtype"] == "bcm94710dev") {
39 if (nvram["boardnum"] == "asusX") {
40 c["lan_ifname"]="eth0 eth1" # FIXME
44 if (nvram["boardtype"] == "bcm94710r4") {
46 c["lan_ifname"] = "eth0"
47 c["wan_ifname"] = "eth1"
49 if (nvram["boardtype"] == "wgt634u") {
50 c["vlan0ports"] = "0 1 2 3 5*"
51 c["vlan1ports"] = "4 5"
53 if ((nvram["boardtype"] == "0x0467") || (nvram["boardtype"] == "0x042f")) {
54 c["vlan0ports"] = "0 1 2 3 5*"
55 c["vlan1ports"] = "4 5"
59 if ((nvram["boardnum"] == "2") || \
60 (nvram["boardnum"] == "1024")) {
61 c["lan_ifname"]="eth0"
65 print "#### VLAN configuration "
66 print "config switch eth0"
67 p("vlan0", "vlan0ports")
68 p("vlan1", "vlan1ports")
71 print "#### Loopback configuration"
72 print "config interface loopback"
73 print " option ifname \"lo\""
74 print " option proto static"
75 print " option ipaddr 127.0.0.1"
76 print " option netmask 255.0.0.0"
79 print "#### LAN configuration"
80 print "config interface lan"
81 print " option type bridge"
82 p("ifname", "lan_ifname")
83 print " option proto static"
84 print " option ipaddr 192.168.1.1"
85 print " option netmask 255.255.255.0"
88 print "#### WAN configuration"
89 print "config interface wan"
90 p("ifname", "wan_ifname")
91 print " option proto dhcp"
92 }' > /etc
/config
/network
This page took 0.062292 seconds and 5 git commands to generate.