inst: don't hardcode /net/ether0, might have usb ethernet

front
cinap_lenrek 2017-08-05 14:30:48 +02:00
parent caddc9a6ea
commit 7d1b9e39f7
3 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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
}