plan9fox/rc/bin/inst/confignet

43 lines
660 B
Text
Raw Normal View History

#!/bin/rc
2011-06-12 08:15:50 +00:00
# desc: configure the network
switch($1){
case checkready checkdone
netdev=/net/ether*
netdev=$netdev(1)
2011-06-12 08:15:50 +00:00
if(~ $netisfrom none){
netdev=/dev/null
2011-06-12 08:15:50 +00:00
confignet=done
export confignet netdev
exit
}
2017-08-04 12:18:40 +00:00
if(~ $netisfrom ether){
x=config$netisfrom
$x=done
./config$netisfrom checkdone
confignet=$$x
export confignet netdev
exit
}
confignet=ready
export confignet netdev
exit
case go
if(! test -d $netdev >[2]/dev/null){
echo
2017-08-04 12:18:40 +00:00
echo 'Could not find ethernet card.'
echo
netisfrom=none
2017-08-04 12:18:40 +00:00
export netisfrom
exit
}
2017-08-04 12:18:40 +00:00
echo
echo 'We will configure the ethernet.'
echo
netisfrom=ether
export netisfrom
2017-08-04 12:18:40 +00:00
exec ./configether go
2011-06-12 08:15:50 +00:00
}