newuser 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/rc
  2. user=`{cat /dev/user}
  3. home=/usr/$user
  4. if(test -f $home/lib/profile){
  5. echo user directories already made
  6. exit no
  7. }
  8. cd $home
  9. x='$'
  10. mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
  11. mkdir lib tmp
  12. chmod +t tmp
  13. bind -c $home/tmp /tmp
  14. mail -c
  15. auth/cron -c
  16. cat > lib/profile <<!
  17. bind -a $x^home/bin/rc /bin
  18. bind -a $x^home/bin/$x^cputype /bin
  19. bind -c $x^home/tmp /tmp
  20. font = /lib/font/bit/pelm/euro.9.font
  21. switch($x^service){
  22. case terminal
  23. plumber
  24. upas/fs
  25. echo -n accelerated > '#m/mousectl'
  26. echo -n 'res 3' > '#m/mousectl'
  27. prompt=('term% ' ' ')
  28. fn term%{ $x^* }
  29. exec rio
  30. case cpu
  31. if (test -e /mnt/term/mnt/wsys) {
  32. # rio already running
  33. wsys = /mnt/term^`{cat /mnt/term/env/wsys}
  34. bind -a /mnt/term/mnt/wsys /dev
  35. echo -n $x^sysname > /dev/label
  36. }
  37. bind /mnt/term/dev/cons /dev/cons
  38. bind /mnt/term/dev/consctl /dev/consctl
  39. bind -a /mnt/term/dev /dev
  40. prompt=('cpu% ' ' ')
  41. fn cpu%{ $x^* }
  42. upas/fs
  43. news
  44. if (! test -e /mnt/term/mnt/wsys) {
  45. # cpu call from drawterm
  46. font=/lib/font/bit/pelm/latin1.8.font
  47. plumber
  48. auth/factotum
  49. exec rio
  50. }
  51. case con
  52. prompt=('cpu% ' ' ')
  53. news
  54. }
  55. !
  56. cat > lib/plumbing <<!
  57. # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
  58. editor = acme
  59. include basic
  60. !
  61. . lib/profile