1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 [ -e /etc
/config
/network
] && exit 0
11 board_name
=$
(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc
/cpuinfo
)
19 function p(cfgname, name) {
20 if (c[name] != "") print " option " cfgname " \"" c[name] "\""
25 c["lan_ifname"]="eth0"
26 c["wan_ifname"]="eth1"
27 c["eth0ports"]="1 2 3 4"
32 if (board == "Compex WP54") {
37 print "#### VLAN configuration "
39 p("eth0", "eth0ports")
40 p("eth1", "eth1ports")
43 print "#### Loopback configuration"
44 print "config interface loopback"
45 print " option ifname \"lo\""
46 print " option proto static"
47 print " option ipaddr 127.0.0.1"
48 print " option netmask 255.0.0.0"
51 print "#### LAN configuration"
52 print "config interface lan"
53 print " option type bridge"
54 p("ifname", "lan_ifname")
55 p("macaddr", "lan_macaddr")
56 print " option proto static"
57 print " option ipaddr 192.168.1.1"
58 print " option netmask 255.255.255.0"
61 print "#### WAN configuration"
62 print "config interface wan"
63 p("ifname", "wan_ifname")
64 p("macaddr", "wan_macaddr")
65 print " option proto dhcp"
66 }' > /etc
/config
/network
This page took 0.048768 seconds and 5 git commands to generate.