C 788 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/rc
  2. rfork n
  3. oflag=()
  4. while(~ $1 -*)
  5. switch($1){
  6. case -r
  7. shift
  8. opt=''
  9. case -O -o
  10. oflag=-O
  11. shift
  12. case *
  13. opt=-r
  14. shift
  15. }
  16. switch($1){
  17. case erika
  18. exec C office1
  19. exit
  20. }
  21. # look for server in /lib/ndb
  22. server=`{ndb/query sys $1 console}
  23. switch($server){
  24. case ''
  25. echo C: unknown console server for $1
  26. exit 1
  27. }
  28. # can't cpu to old servers any more
  29. switch($server){
  30. case dinar bones
  31. ssh $server C $1
  32. exit 0
  33. }
  34. if(! test -e /mnt/consoles/$1){
  35. switch($sysname){
  36. case $server
  37. mount /srv/consoles /mnt/consoles
  38. case *
  39. import $oflag $server /mnt/consoles
  40. }
  41. }
  42. if(! test -e /mnt/consoles/$1 && test -e /srv/consoles)
  43. mount /srv/consoles /mnt/consoles
  44. if(! test -e /mnt/consoles/$1){
  45. echo console not found
  46. exit 'console not found'
  47. }
  48. con -l $opt /mnt/consoles/$1