newuser 1.2 KB

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