summaryrefslogtreecommitdiff
path: root/sys/lib/newuser
blob: fd6e6d887b2d83ab713bb560690319b6b8c7aeeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/rc

user=`{cat /dev/user}
home=/usr/$user
if(test -f $home/lib/profile){
	echo user directories already made
	exit no
}
cd $home
x='$'
mkdir bin bin/rc bin/mips bin/386 bin/amd64 bin/power bin/arm
mkdir lib tmp
chmod +t tmp
bind -qc /n/other/usr/$user/tmp $home/tmp
bind -c $home/tmp /tmp
mail -c
auth/cron -c

cat > lib/profile <<!
bind -qa $x^home/bin/rc /bin
bind -qa $x^home/bin/$x^cputype /bin
font=/lib/font/bit/vga/unicode.font
switch($x^service){
case terminal
	webcookies
	webfs
	plumber
	echo -n accelerated > '#m/mousectl'
	echo -n 'res 3' > '#m/mousectl'
	prompt=('term% ' '	')
	fn term%{ $x^* }
	rio
case cpu
	bind /mnt/term/dev/cons /dev/cons
	bind -q /mnt/term/dev/consctl /dev/consctl
	>[2] /dev/null {
		cp /dev/sysname /mnt/term/dev/label
		if(wsys=`{cat /mnt/term/env/wsys})
			wsys=/mnt/term^$x^wsys
	} 
	bind -a /mnt/term/dev /dev
	prompt=('cpu% ' '	')
	fn cpu%{ $x^* }
	if(! test -e /mnt/term/dev/wsys){
		# call from drawterm
		if(test -e /mnt/term/dev/secstore){
			auth/factotum -n
			read -m /mnt/term/dev/secstore >/mnt/factotum/ctl
			echo >/mnt/term/dev/secstore
		}
		if not
			auth/factotum
		webcookies
		webfs
		plumber
		rio
	}
case con
	prompt=('cpu% ' '	')
}
!
cat > lib/plumbing <<!
# to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules

editor = sam
browser = mothra

include basic

!

. lib/profile