termrc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. aux/timesync $TIMESYNCARGS
  26. # bind all likely devices (#S was bound in boot)
  27. for(i in f t m v L P U '$' Σ κ)
  28. /bin/bind -a '#'^$i /dev >/dev/null >[2=1]
  29. diskparts
  30. # watch this space
  31. if(! ~ `{cat /dev/user} none)
  32. aux/vmware
  33. if(~ $mouseport ask){
  34. echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
  35. mouseport=`{read}
  36. if(~ $#mouseport 0)
  37. mouseport=ps2
  38. }
  39. if(~ $vgasize ask){
  40. echo -n 'vgasize [640x480x8]: '
  41. vgasize=`{read}
  42. if(~ $#vgasize 0)
  43. vgasize=640x480x8
  44. }
  45. if(~ $monitor ask){
  46. echo -n 'monitor is [xga]: '
  47. monitor=`{read}
  48. if(~ $#monitor 0)
  49. monitor=xga
  50. }
  51. if(test -f /dev/mousectl){
  52. switch($mouseport){
  53. case ps2 ps2intellimouse 0 1 2
  54. aux/mouse $mouseport
  55. # parse vgasize into fields
  56. vgasize=`{echo $vgasize}
  57. if(! ~ $"monitor '' && ! ~ `{cat /dev/user} none)
  58. aux/vga -l $vgasize
  59. if(~ $accupoint 1)
  60. pipefile -dr /bin/aux/accupoint /dev/mouse
  61. }
  62. }
  63. # start up local swapping
  64. disk=`{ls /dev/sd*/swap >[2]/dev/null}
  65. if (! ~ $#disk 0)
  66. swap $disk(1) >/dev/null >[2=1]
  67. rm /env/disk