]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/newuser
merge
[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/power bin/arm
12 mkdir lib tmp
13 chmod +t tmp
14 # try to create tmp space on other
15 9fs other >/dev/null >[2=1] && \
16         mkdir -m 775 /n/other/usr/$user >/dev/null >[2=1] && \
17         mkdir -m 750 /n/other/usr/$user/tmp >/dev/null >[2=1] && \
18         bind -c /n/other/usr/$user/tmp $home/tmp
19 bind -c $home/tmp /tmp
20
21 mail -c
22 auth/cron -c
23
24 cat > lib/profile <<!
25 bind -a $x^home/bin/rc /bin
26 bind -a $x^home/bin/$x^cputype /bin
27 bind -c $x^home/tmp /tmp
28 font = /lib/font/bit/pelm/euro.9.font
29 switch($x^service){
30 case terminal
31         plumber
32         startupasfs
33         echo -n accelerated > '#m/mousectl'
34         echo -n 'res 3' > '#m/mousectl'
35         prompt=('term% ' '      ')
36         fn term%{ $x^* }
37         exec rio
38 case cpu
39         if (test -e /mnt/term/mnt/wsys) {
40                 # rio already running
41                 wsys = /mnt/term^`{cat /mnt/term/env/wsys}
42                 bind -a /mnt/term/mnt/wsys /dev
43                 echo -n $x^sysname > /dev/label
44         }
45         bind /mnt/term/dev/cons /dev/cons
46         bind /mnt/term/dev/consctl /dev/consctl
47         bind -a /mnt/term/dev /dev
48         prompt=('cpu% ' '       ')
49         fn cpu%{ $x^* }
50         startupasfs
51         news
52         if (! test -e /mnt/term/mnt/wsys) {
53                 # cpu call from drawterm
54                 font=/lib/font/bit/pelm/latin1.8.font
55                 plumber
56                 auth/factotum
57                 exec rio
58         }
59 case con
60         prompt=('cpu% ' '       ')
61         startupasfs
62         news
63 }
64 !
65 cat > lib/plumbing <<!
66 # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
67
68 editor = acme
69
70 include basic
71
72 !
73
74 . lib/profile