inst: don't hardcode /net/ether0, might have usb ethernet
parent
caddc9a6ea
commit
7d1b9e39f7
|
@ -4,9 +4,12 @@
|
||||||
|
|
||||||
switch($1){
|
switch($1){
|
||||||
case checkready checkdone
|
case checkready checkdone
|
||||||
|
netdev=/net/ether*
|
||||||
|
netdev=$netdev(1)
|
||||||
if(~ $netisfrom none){
|
if(~ $netisfrom none){
|
||||||
|
netdev=/dev/null
|
||||||
confignet=done
|
confignet=done
|
||||||
export confignet
|
export confignet netdev
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
if(~ $netisfrom ether){
|
if(~ $netisfrom ether){
|
||||||
|
@ -14,15 +17,15 @@ case checkready checkdone
|
||||||
$x=done
|
$x=done
|
||||||
./config$netisfrom checkdone
|
./config$netisfrom checkdone
|
||||||
confignet=$$x
|
confignet=$$x
|
||||||
export confignet
|
export confignet netdev
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
confignet=ready
|
confignet=ready
|
||||||
export confignet
|
export confignet netdev
|
||||||
exit
|
exit
|
||||||
|
|
||||||
case go
|
case go
|
||||||
if(! test -d /net/ether0 >[2]/dev/null){
|
if(! test -d $netdev >[2]/dev/null){
|
||||||
echo
|
echo
|
||||||
echo 'Could not find ethernet card.'
|
echo 'Could not find ethernet card.'
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# desc: setup network configuration
|
# desc: setup network configuration
|
||||||
# prereq: confignet copydist
|
# prereq: confignet copydist
|
||||||
|
|
||||||
etheraddr=`{cat /net/ether0/addr >[2]/dev/null}
|
etheraddr=`{cat $netdev/addr >[2]/dev/null}
|
||||||
|
|
||||||
switch($1){
|
switch($1){
|
||||||
case checkready checkdone
|
case checkready checkdone
|
||||||
|
|
|
@ -5,25 +5,25 @@
|
||||||
|
|
||||||
switch($1) {
|
switch($1) {
|
||||||
case checkready
|
case checkready
|
||||||
if(isipdevup /net/ether0) {
|
if(isipdevup $netdev) {
|
||||||
startether=done
|
startether=done
|
||||||
export startether
|
export startether
|
||||||
}
|
}
|
||||||
|
|
||||||
case go
|
case go
|
||||||
if(isipdevup /net/ether0)
|
if(isipdevup $netdev)
|
||||||
exit
|
exit
|
||||||
|
|
||||||
log starting ethernet $ethermethod config
|
log starting ethernet $ethermethod config
|
||||||
switch($ethermethod) {
|
switch($ethermethod) {
|
||||||
case manual
|
case manual
|
||||||
ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log
|
ip/ipconfig -g $gwaddr ether $netdev $ipaddr $ipmask >>[2]/srv/log
|
||||||
case dhcp
|
case dhcp
|
||||||
ip/ipconfig >>[2]/srv/log
|
ip/ipconfig >>[2]/srv/log
|
||||||
}
|
}
|
||||||
|
|
||||||
case checkdone
|
case checkdone
|
||||||
if(! isipdevup /net/ether0) {
|
if(! isipdevup $netdev) {
|
||||||
startether=notdone
|
startether=notdone
|
||||||
export startether
|
export startether
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue