plan9fox/sys/lib/newuser

75 lines
1.4 KiB
Text
Raw Normal View History

#!/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/power bin/arm
mkdir lib tmp
2012-01-11 15:17:54 +00:00
touch lib/webcookies
chmod 600 lib/webcookies
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 -a $x^home/bin/rc /bin
bind -a $x^home/bin/$x^cputype /bin
2011-04-29 12:50:51 +00:00
mount -qC /srv/cwfs /n/other other
bind -qc /n/other/usr/$x^user/tmp $x^home/tmp
bind -c $x^home/tmp /tmp
font=/lib/font/bit/vga/unicode.font
switch($x^service){
case terminal
2012-01-11 15:17:54 +00:00
webcookies
webfs
plumber
startupasfs
echo -n accelerated > '#m/mousectl'
echo -n 'res 3' > '#m/mousectl'
prompt=('term% ' ' ')
fn term%{ $x^* }
exec rio
case cpu
if (test -e /mnt/term/mnt/wsys) {
# rio already running
wsys = /mnt/term^`{cat /mnt/term/env/wsys}
bind -a /mnt/term/mnt/wsys /dev
echo -n $x^sysname > /dev/label
}
bind /mnt/term/dev/cons /dev/cons
bind /mnt/term/dev/consctl /dev/consctl
bind -a /mnt/term/dev /dev
prompt=('cpu% ' ' ')
fn cpu%{ $x^* }
startupasfs
if (! test -e /mnt/term/mnt/wsys) {
# cpu call from drawterm
font=/lib/font/bit/vga/unicode.font
plumber
auth/factotum
exec rio
}
case con
prompt=('cpu% ' ' ')
startupasfs
}
!
cat > lib/plumbing <<!
# to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
editor = sam
browser = mothra
include basic
!
. lib/profile