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