@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 OpenWrt.org
START=0 5
START=1 5
# hardware
# hardware
# the 'Hardware' string from cpuinfo
# the 'Hardware' string from cpuinfo
@ -25,18 +25,6 @@ machine(){
esac
esac
}
}
# Returns the mtd device with the specified name (without leading /dev)
# $1 = name of mtd device
get_mtd() {
grep "\"$1\"*$" /proc/mtd | cut -d : -f 1
}
# Returns the mtd block device with the specified name (without leading /dev)
# $1 = name of mtd device
get_mtdblock() {
echo $(get_mtd "$1") | sed 's/mtd/mtdblock/'
}
start() {
start() {
[ -e /etc/config/network ] && exit 0
[ -e /etc/config/network ] && exit 0
@ -62,7 +50,6 @@ start() {
BEGIN {
BEGIN {
FS="="
FS="="
getline model
}
}
{ c[$1] = $2 }
{ c[$1] = $2 }
@ -78,8 +65,8 @@ start() {
print ""
print ""
print "#### LAN configuration"
print "#### LAN configuration"
print "config interface lan"
print "config interface lan"
print " option ifname eth0 "
print " option ifname \"eth0\" "
if ((model == "nslu2") || (model == "nas100d")) {
if ((c[" model"] == "nslu2") || (c[" model"] == "nas100d")) {
p("proto", "bootproto")
p("proto", "bootproto")
p("ipaddr", "ip_addr")
p("ipaddr", "ip_addr")
p("netmask", "netmask")
p("netmask", "netmask")
@ -88,7 +75,10 @@ start() {
p("hostname", "disk_server_name")
p("hostname", "disk_server_name")
}
}
else {
else {
print " option proto dhcp"
print " option proto dhcp"
}
}
}' > /etc/config/network
}' > /etc/config/network
ifup loopback
ifup lan
}
}