startether 513 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/rc
  2. # desc: activate ethernet card
  3. # prereq: configether
  4. switch($1) {
  5. case checkready
  6. if(isipdevup /net/ether0) {
  7. startether=done
  8. export startether
  9. }
  10. case go
  11. if(isipdevup /net/ether0)
  12. exit
  13. log starting ethernet $ethermethod config
  14. switch($ethermethod) {
  15. case manual
  16. ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log
  17. case dhcp
  18. ip/ipconfig $dhcphost -D >>/srv/log >[2=1]
  19. }
  20. case checkdone
  21. if(! isipdevup /net/ether0) {
  22. startether=notdone
  23. export startether
  24. }
  25. }