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