newuser 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 bin/amd64
  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. startupasfs
  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. startupasfs
  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. startupasfs
  54. news
  55. }
  56. !
  57. cat > lib/plumbing <<!
  58. # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
  59. editor = acme
  60. include basic
  61. !
  62. . lib/profile