termrc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/rc -x
  2. # replace FILESERVER with the name of your file server
  3. # here we start with kfs, your local disk file system
  4. fileserver=kfs
  5. # replace CPU with the name of your cpu server
  6. cpu=CPU
  7. # replace FACEDOM with the local domain to be used in the faces database
  8. facedom=FACEDOM
  9. TIMESYNCARGS=-rLa1000000
  10. NDBFILE=/lib/ndb/local
  11. if(test -e /rc/bin/termrc.local)
  12. . /rc/bin/termrc.local
  13. # cs sets sysname
  14. ndb/cs -f $NDBFILE
  15. sysname=`{cat /dev/sysname}
  16. # start IP on the LAN. It's commented out to avoid a long timeout
  17. # on startup waiting for DHCP.
  18. #
  19. # If your system has DHCP
  20. #
  21. #if(! test -e /net/ipifc/0/ctl)
  22. # ip/ipconfig >/dev/null >[2=1]
  23. #
  24. # Otherwise use
  25. #
  26. #if(! test -e /net/ipifc/0/ctl)
  27. # ip/ipconfig -g your-gateway ether /net/ether0 your-ip-address your-subnet-mask >/dev/null >[2=1]
  28. if(test -e /net/ipifc/0/ctl)
  29. ndb/dns -rf $NDBFILE
  30. aux/timesync $TIMESYNCARGS
  31. switch($terminal){
  32. case carrera*
  33. bind -a '#t' /dev
  34. case *' ss'*
  35. /bin/bind -a '#w' /dev >/dev/null >[2=1]
  36. /bin/bind -a '#t' /dev >/dev/null >[2=1]
  37. case *' magnum'*
  38. /bin/bind -a '#m' /dev >/dev/null >[2=1]
  39. /bin/bind -a '#t' /dev >/dev/null >[2=1]
  40. aux/mouse -dC 0
  41. case *' indigo'*
  42. /bin/bind -a '#L' /dev >/dev/null >[2=1]
  43. /bin/bind -a '#w1' /dev >/dev/null >[2=1]
  44. /bin/bind -a '#t' /dev >/dev/null >[2=1]
  45. /bin/bind -a '#A' /dev >/dev/null >[2=1]
  46. case NCR* 'AT&TNSX'* generic* _MP_* 'alpha apc'*
  47. for(i in H w f t m v L S P U '$' Σ)
  48. /bin/bind -a '#'^$i /dev >/dev/null >[2=1]
  49. for(disk in /dev/sd??) {
  50. if(test -f $disk/data && test -f $disk/ctl)
  51. disk/fdisk -p $disk/data >$disk/ctl >[2]/dev/null
  52. for(part in $disk/plan9*)
  53. if(test -f $part)
  54. disk/prep -p $part >$disk/ctl >[2]/dev/null
  55. }
  56. if(! ~ `{cat /dev/user} none)
  57. aux/vmware
  58. if(~ $mouseport ask){
  59. echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
  60. mouseport=`{read}
  61. if(~ $#mouseport 0)
  62. mouseport=ps2
  63. }
  64. if(~ $vgasize ask){
  65. echo -n 'vgasize [640x480x8]: '
  66. vgasize=`{read}
  67. if(~ $#vgasize 0)
  68. vgasize=640x480x8
  69. }
  70. if(~ $monitor ask){
  71. echo -n 'monitor is [xga]: '
  72. monitor=`{read}
  73. if(~ $#monitor 0)
  74. monitor=xga
  75. }
  76. if(test -f /dev/mousectl){
  77. switch($mouseport){
  78. case ps2 ps2intellimouse 0 1 2
  79. aux/mouse $mouseport
  80. # parse vgasize into fields
  81. vgasize=`{echo $vgasize}
  82. if(! ~ $"monitor '' && ! ~ `{cat /dev/user} none)
  83. aux/vga -l $vgasize
  84. if(~ $accupoint 1)
  85. pipefile -dr /bin/aux/accupoint /dev/mouse
  86. }
  87. }
  88. disk=''
  89. if(test -f /dev/sd*/swap)
  90. disk=`{ls /dev/sd*/swap >[2]/dev/null | sed 1q | sed 's!swap$!!'}
  91. if(! ~ $disk '') {
  92. swap $disk^swap >/dev/null >[2=1]
  93. dossrv
  94. c:
  95. }
  96. }