termrc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/rc
  2. # terminal startup
  3. TIMESYNCARGS=(-rLa1000000)
  4. NDBFILE=/lib/ndb/local
  5. if(test -e /rc/bin/termrc.local)
  6. . /rc/bin/termrc.local
  7. mntgen -s slashn && chmod 666 /srv/slashn
  8. # cs sets sysname
  9. ndb/cs -f $NDBFILE
  10. sysname=`{cat /dev/sysname}
  11. # start IP on the LAN. It's commented out to avoid a long timeout
  12. # on startup waiting for DHCP.
  13. #
  14. # If your system has DHCP
  15. #
  16. #if(! test -e /net/ipifc/0/ctl)
  17. # ip/ipconfig >/dev/null >[2=1]
  18. #
  19. # Otherwise use
  20. #
  21. #if(! test -e /net/ipifc/0/ctl)
  22. # ip/ipconfig -g your-gateway ether /net/ether0 your-ip-address your-subnet-mask >/dev/null >[2=1]
  23. if(test -e /net/ipifc/0/ctl)
  24. ndb/dns -rf $NDBFILE
  25. if(! ps|grep -s timesync)
  26. aux/timesync $TIMESYNCARGS
  27. # bind all likely devices (#S was bound in boot)
  28. for(i in f t m v L P U '$' Σ κ)
  29. /bin/bind -a '#'^$i /dev >/dev/null >[2=1]
  30. diskparts
  31. # watch this space
  32. if(! ~ `{cat /dev/user} none)
  33. aux/vmware
  34. if(~ $mouseport ask){
  35. echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
  36. mouseport=`{read}
  37. if(~ $#mouseport 0)
  38. mouseport=ps2
  39. }
  40. if(~ $vgasize ask){
  41. echo -n 'vgasize [640x480x8]: '
  42. vgasize=`{read}
  43. if(~ $#vgasize 0)
  44. vgasize=640x480x8
  45. }
  46. if(~ $monitor ask){
  47. echo -n 'monitor is [xga]: '
  48. monitor=`{read}
  49. if(~ $#monitor 0)
  50. monitor=xga
  51. }
  52. if(test -f /dev/mousectl){
  53. switch($mouseport){
  54. case ps2 ps2intellimouse 0 1 2
  55. aux/mouse $mouseport
  56. # parse vgasize into fields
  57. vgasize=`{echo $vgasize}
  58. if(! ~ $"monitor '' && ! ~ `{cat /dev/user} none)
  59. aux/vga -l $vgasize
  60. if(~ $accupoint 1)
  61. pipefile -dr /bin/aux/accupoint /dev/mouse
  62. }
  63. }
  64. # start up local swapping
  65. disk=`{ls /dev/sd*/swap >[2]/dev/null}
  66. if (! ~ $#disk 0)
  67. swap $disk(1) >/dev/null >[2=1]
  68. rm /env/disk