confignet 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/rc
  2. # prereq: configdist
  3. # desc: configure the network to download the distribution
  4. switch($1){
  5. case checkready checkdone
  6. if(! ~ $distisfrom net){
  7. confignet=notdone
  8. export confignet
  9. exit
  10. }
  11. if(~ $distisfrom net && ~ $netisfrom ppp ether){
  12. x=config$netisfrom
  13. $x=done
  14. config$netisfrom checkdone
  15. confignet=$$x
  16. export confignet
  17. exit
  18. }
  19. confignet=ready
  20. export confignet
  21. exit
  22. case go
  23. devs=''
  24. if(test -d '#l/ether0' >[2]/dev/null)
  25. devs=$devs^ether
  26. if(test -f '#t'/eia? >[2]/dev/null)
  27. devs=$devs^ppp
  28. switch($devs){
  29. case ''
  30. echo
  31. echo 'Could not find ethernet card nor serial port nor modem.'
  32. echo 'Please use a local copy of the distribution archive.'
  33. echo
  34. netisfrom=none
  35. case ppp
  36. echo
  37. echo 'No ethernet card was detected, but there is a serial port or modem.'
  38. echo 'We will configure PPP.'
  39. echo
  40. netisfrom=ppp
  41. case ether
  42. echo
  43. echo 'No serial port or modem detected, but there is an ethernet card.'
  44. echo 'We will configure the ethernet.'
  45. echo
  46. netisfrom=ether
  47. case etherppp
  48. echo
  49. echo 'You can connect to the internet via'
  50. echo 'a local ethernet or a dial-up PPP connection.'
  51. echo
  52. prompt 'Interface to use' ether ppp
  53. netisfrom=$rd
  54. }
  55. export netisfrom
  56. if(~ $netisfrom ether ppp)
  57. exec config$netisfrom go
  58. }