]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/newuser
devproc: fix mistake
[plan9front.git] / sys / lib / newuser
1 #!/bin/rc
2
3 user=`{cat /dev/user}
4 home=/usr/$user
5 if(test -f $home/lib/profile){
6         echo user directories already made
7         exit no
8 }
9 cd $home
10 x='$'
11 mkdir bin bin/rc bin/mips bin/386 bin/amd64 bin/power bin/arm
12 mkdir lib tmp
13 chmod +t tmp
14 bind -qc /n/other/usr/$user/tmp $home/tmp
15 bind -c $home/tmp /tmp
16 mail -c
17 auth/cron -c
18
19 cat > lib/profile <<!
20 bind -qa $x^home/bin/rc /bin
21 bind -qa $x^home/bin/$x^cputype /bin
22 mount -qC /srv/boot /n/other other
23 bind -qc /n/other/usr/$x^user/tmp $x^home/tmp
24 bind -c $x^home/tmp /tmp
25 font=/lib/font/bit/vga/unicode.font
26 switch($x^service){
27 case terminal
28         webcookies
29         webfs
30         plumber
31         echo -n accelerated > '#m/mousectl'
32         echo -n 'res 3' > '#m/mousectl'
33         prompt=('term% ' '      ')
34         fn term%{ $x^* }
35         rio
36 case cpu
37         bind /mnt/term/dev/cons /dev/cons
38         bind -q /mnt/term/dev/consctl /dev/consctl
39         >[2] /dev/null {
40                 cp /dev/sysname /mnt/term/dev/label
41                 if(wsys=`{cat /mnt/term/env/wsys})
42                         wsys=/mnt/term^$x^wsys
43         } 
44         bind -a /mnt/term/dev /dev
45         prompt=('cpu% ' '       ')
46         fn cpu%{ $x^* }
47         if(! test -e /mnt/term/dev/wsys){
48                 # call from drawterm
49                 if(test -e /mnt/term/dev/secstore){
50                         auth/factotum -n
51                         read -m /mnt/term/dev/secstore >/mnt/factotum/ctl
52                         echo >/mnt/term/dev/secstore
53                 }
54                 if not
55                         auth/factotum
56                 webcookies
57                 webfs
58                 plumber
59                 rio
60         }
61 case con
62         prompt=('cpu% ' '       ')
63 }
64 !
65 cat > lib/plumbing <<!
66 # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
67
68 editor = sam
69 browser = mothra
70
71 include basic
72
73 !
74
75 . lib/profile