#!/dis/sh.dis
load std
autoload=std

bind -c /dis /dis
bind -a '#w' /dev
bind -c '#splumber' /chan
bind -a '#^' /chan
if {ftest -d '#A'}{
	bind -a '#A' /dev
}

run $home/lib/functions
if {! ftest -f /net/dns}{
	ndb/dns -r
}
if {! ftest -f /net/cs}{
	ndb/cs
}
if {! ftest -f /mnt/factotum/proto}{
	auth/factotum
}

if {! ftest -d /fonts/lucidasans}{
	echo 'No Inferno fonts found. Run setupfonts to copy /fonts from www.vitanuova.com Inferno distribution.'
	acme-font=/fonts/vera/Vera/unicode.14.font
	acme-Font=/fonts/vera/VeraMono/VeraMono.14.font
}

acme -a $home $home/README 
sleep 1
waitid = `{sed '' /prog/*/status | sort -n | grep Acme | sed 1q | sed 's/^ +([0-9]+) +.*/\1/'}
read < /prog/^$waitid^/wait
sleep 2
echo halt > /dev/sysctl
