configip 1.1 KB

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