xref: /plan9/sys/lib/newuser (revision 8c242bd446c884bfe67eb34810750d4b2aec1ba2)
1#!/bin/rc
2
3user=`{cat /dev/user}
4home=/usr/$user
5if(test -f $home/lib/profile){
6	echo user directories already made
7	exit no
8}
9cd $home
10x='$'
11mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm bin/amd64
12mkdir lib tmp
13chmod +t tmp
14bind -c $home/tmp /tmp
15
16mail -c
17auth/cron -c
18
19cat > lib/profile <<!
20bind -a $x^home/bin/rc /bin
21bind -a $x^home/bin/$x^cputype /bin
22bind -c $x^home/tmp /tmp
23font = /lib/font/bit/pelm/euro.9.font
24switch($x^service){
25case terminal
26	plumber
27	startupasfs
28	echo -n accelerated > '#m/mousectl'
29	echo -n 'res 3' > '#m/mousectl'
30	prompt=('term% ' '	')
31	fn term%{ $x^* }
32	exec rio
33case cpu
34	if (test -e /mnt/term/mnt/wsys) {
35		# rio already running
36		wsys = /mnt/term^`{cat /mnt/term/env/wsys}
37		bind -a /mnt/term/mnt/wsys /dev
38		echo -n $x^sysname > /dev/label
39	}
40	bind /mnt/term/dev/cons /dev/cons
41	bind /mnt/term/dev/consctl /dev/consctl
42	bind -a /mnt/term/dev /dev
43	prompt=('cpu% ' '	')
44	fn cpu%{ $x^* }
45	startupasfs
46	news
47	if (! test -e /mnt/term/mnt/wsys) {
48		# cpu call from drawterm
49		font=/lib/font/bit/pelm/latin1.8.font
50		plumber
51		auth/factotum
52		exec rio
53	}
54case con
55	prompt=('cpu% ' '	')
56	startupasfs
57	news
58}
59!
60cat > lib/plumbing <<!
61# to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
62
63editor = acme
64
65include basic
66
67!
68
69. lib/profile
70