1
0

newuser 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. mkdir /cron/$user
  13. chmod 775 /cron/$user
  14. chgrp $user /cron/$user
  15. bind -c $home/tmp /tmp
  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. exec rio
  48. }
  49. case con
  50. prompt=('cpu% ' ' ')
  51. news
  52. }
  53. !
  54. cat > lib/plumbing <<!
  55. # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
  56. editor = acme
  57. include basic
  58. !
  59. . lib/profile