<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf8">
<title>/usr/web/sources/contrib/rsc/profile - Plan 9 from Bell Labs</title>
<!-- THIS FILE IS AUTOMATICALLY GENERATED. -->
<!-- EDIT sources.tr INSTEAD. -->
</meta>
</head>
<body>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<p style="line-height: 1.2em; margin-left: 1.00in; text-indent: 0.00in; margin-right: 1.00in; margin-top: 0; margin-bottom: 0; text-align: center;">
<span style="font-size: 10pt"><a href="/plan9/">Plan 9 from Bell Labs</a>&rsquo;s /usr/web/sources/contrib/rsc/profile</span></p>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<center><font size=-1>
Copyright © 2009 Alcatel-Lucent.<br />
Distributed under the
<a href="/plan9/license.html">Lucent Public License version 1.02</a>.
<br />
<a href="/plan9/download.html">Download the Plan 9 distribution.</a>
</font>
</center>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<table width="100%" cellspacing=0 border=0><tr><td align="center">
<table cellspacing=0 cellpadding=5 bgcolor="#eeeeff"><tr><td align="left">
<pre>
<!-- END HEADER -->
# bin
bind -b $home/bin/$cputype /bin
bind -b $home/bin/rc /bin
if(test -d /usr/inferno/Inferno/386/bin)
	bind -a /usr/inferno/Inferno/386/bin /bin
if(test -d /usr/inferno/Plan9/386/bin)
	bind -a /usr/inferno/Plan9/386/bin /bin

facedom=astro
weather=bos
tz=US_Eastern
wisconsin=no

cp /adm/timezone/$tz /env/timezone

# if(~ $service rx)
# 	exit ''



if(~ $#sysname 0)
	sysname=gnot

# where are we?
ipaddr=`{netstat -i | sed 1q | awk '{print $3}'}
if(! ~ $#ipaddr 1)
	ipaddr=none

if(~ $service terminal &amp;&amp; test -d /mnt/term/dev)
	service=cpu

switch($service) {
case terminal
	if(test -f '#P/apm')
		aux/apm
	switch($ipaddr) {
	case none
		;
	case *
		if(test -f /n/other/rsc/fact.keys)
			read -m /n/other/rsc/fact.keys &gt;/mnt/factotum/ctl
		if(~ `{wc -l &lt;/mnt/factotum/ctl} 0)
			auth/secstore -G factotum | aux/lines &gt;/mnt/factotum/ctl
	}
}

# mount some file systems
switch($service.$ipaddr) {
case *.none
	;
case terminal.135.104.9.*
	srv -m emelie emelie /n/emelie
	9fs emelieother
	9fs alice
	9fs nslocum
case terminal.135.207.*.*
#	recover -e tcp!10.252.0.122 emelie /n/emelie
	9fs eecs
	9fs cs121
case terminal.140.247.*.*
	srvemelie
	9fs emelie
	9fs eecs
	9fs cs121
case terminal.135.104.*.*
#	recover emelie emelie /n/emelie
	9fs emelieother
	9fs eecs
	9fs cs121
case terminal.18.24.*.*
	9fs ny
	bind -c /n/ny/home/ny3/rsc /usr/rsc/lcs
}

# tmp
fileserver=`{cat /env/fileserver}		# not sure why this is needed
switch($fileserver){
case emelie fs
	9fs other
	bind -c /n/other/rsc/tmp /tmp
case kfs
	9fs kfs
	bind -c /n/kfs/rsc/tmp /tmp
case *
	ramfs
}

# time
switch($sysname){
case 17genr
	kill timesync|rc
	aux/timesync -n plan9.bell-labs.com
}

# faces
bind -b /usr/rsc/lib/face /lib/face/48x48x4

# troff -mpm
bind -a /usr/rsc/lib/tmac /sys/lib/tmac

# mail
mail=/mail/box/$user
ihome=/usr/inferno/usr/rsc
# fn z { ls -lt $mail/mbox $mail/^(render risks)^/mbox /mail/box/9trouble/mbox }
fn z { ls -lt $mail/mbox /mail/box/9trouble/mbox }

# imported goods
switch($ipaddr){
case 135.104.*.*
	;
case none
	;
case 140.247.*.* 135.207.*.*
	bind -c /n/emelie/$mail $mail
	bind /dev/null $mail/mbox
#	bind -c /n/emelie/sys/src /sys/src
	bind -c /usr/rsc /usr/rsc
	bind -a /n/emelie/usr/rsc /usr/rsc
	bind -c /usr /usr
	bind -a /n/emelie/usr /usr
}

# cpu
switch($ipaddr){
case 135.104.*.*
	cpu=olive
case *
	cpu='$cpu'
}

# lp
switch($sysname^'!'^$ipaddr){
case ovid!*
	LPDEST=bjc600
case *!140.247.6*.*
	LPDEST=vogon
case *!135.104.*.*
	LPDEST=u
case *
	LPDEST=unknown
}

# special characters
tab='	'
nl='
'
cr=''

# custom cd, pwd
if(~ $service terminal)
	sys=g
if not
	sys=$sysname

pwd=`{pwd}
lwd=$pwd
ps1='% '
prompt=($sys^$ps1 $tab)
fn $sys^'%' { if(! ~ $#* 0) $* }
fn cd {
	if(! ~ $#* 0) {
		arg=$1
		switch($arg){
		case -
			arg=$lwd
		case -/*
			arg=`{echo $arg | sed 's#^-#'$lwd'#' | cleanname}
		}
	} 
	if not
		arg=()

	builtin cd $arg &amp;&amp; {
		awd
		if(test -w /dev/label){
			if(~ $service terminal)
				echo -n `{pwd} &gt;/dev/label
			if(~ $service cpu)
				echo -n $sysname `{pwd} &gt;/dev/label
		}
		status=''
	}
}

# new fonts for acme
fn acme {/bin/acme -f /lib/font/bit/lucidasans/unicode.8.font $*}

fn small {
	fn acme { /bin/acme -f/lib/font/bit/lucidasans/unicode.7.font -F$font $* }
#	font=/lib/font/bit/lucidasans/typelatin1.7.font
	if(! ~ $#* 0)
		$*
}
font=/lib/font/bit/lucm/unicode.9.font

# distribution
d=/n/sources/plan9
t=/n/emelietemp/crp/sources.copy
9fs emelietemp
9fs sources
D=/n/emelietemp/testplan9

# 9pm
# bind -c /usr/rsc/9pm /9pm
# bind -a /9pm/Plan9/386/bin /bin

# CVS
EDITOR=plumbit

switch($service){
case terminal
	if(test -f /dev/mousectl){
		echo -n hwaccel off &gt;/dev/mousectl
		echo -n accelerated 4 &gt;/dev/mousectl
		echo -n res 3 &gt;/dev/mousectl
	}

	# usb
	bind -a '#U' /dev &gt;[2]/dev/null
	if(test -d /dev/usb0){
		usb/usbd
		usb/usbaudio
	}

	if(! test -f /mail/box/rsc/names &amp;&amp; test -f /n/emelie/mail/box/rsc/names)
		bind /n/emelie/mail/box/rsc /mail/box/rsc
	plumber
	switch($ipaddr){
	case none
		;
	case 135.104.9.*
		upas/fs
	case *
		echo -n pop...
		switch($wisconsin){
		case yes
			upas/fs
		case *
			upas/fs -f/apoptls/plan9.bell-labs.com/rsc &gt;&gt;[2]/tmp/poplog
		}
		echo
	}
	if(~ `{screensize} small)
		small
	exec rio -i riostart

case cpu
	bind /mnt/term/dev/cons /dev/cons
	bind /mnt/term/dev/consctl /dev/consctl
	bind -a /mnt/term/dev /dev

	if (test -e /mnt/term/mnt/wsys) {
		# rio already running
		bind -a /mnt/term/mnt/wsys /dev
		if(test -w /dev/label)
			echo -n $sysname &gt; /dev/label
		upas/fs -p
	}
	if not {	# drawterm
		plumber
		upas/fs
	}

	#fortune
	news
	if(test -f /mnt/term/env/wsys)
		wsys=/mnt/term/`{cat /mnt/term/env/wsys}

	if (! test -e /mnt/term/mnt/wsys) {
		# cpu call from drawterm
		#exec rio -i driostart
		if(~ `{screensize} small)
			small
	}
case con
	news
}
<!-- BEGIN TAIL -->
</pre>
</td></tr></table>
</td></tr></table>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<p style="line-height: 1.2em; margin-left: 1.00in; text-indent: 0.00in; margin-right: 1.00in; margin-top: 0; margin-bottom: 0; text-align: center;">
<span style="font-size: 10pt"></span></p>
<p style="margin-top: 0; margin-bottom: 0.50in"></p>
<p style="margin-top: 0; margin-bottom: 0.33in"></p>
<center><table border="0"><tr>
<td valign="middle"><a href="http://www.alcatel-lucent.com/"><img border="0" src="/plan9/img/logo_ft.gif" alt="Bell Labs" />
</a></td>
<td valign="middle"><a href="http://www.opensource.org"><img border="0" alt="OSI certified" src="/plan9/img/osi-certified-60x50.gif" />
</a></td>
<td><img style="padding-right: 45px;" alt="Powered by Plan 9" src="/plan9/img/power36.gif" />
</td>
</tr></table></center>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<center>
<span style="font-size: 10pt">(<a href="/plan9/">Return to Plan 9 Home Page</a>)</span>
</center>
<p style="margin-top: 0; margin-bottom: 0.17in"></p>
<center><font size=-1>
<span style="font-size: 10pt"><a href="http://www.lucent.com/copyright.html">Copyright</a></span>
<span style="font-size: 10pt">© 2009 Alcatel-Lucent.</span>
<span style="font-size: 10pt">All Rights Reserved.</span>
<br />
<span style="font-size: 10pt">Comments to</span>
<span style="font-size: 10pt"><a href="mailto:webmaster@plan9.bell-labs.com">webmaster@plan9.bell-labs.com</a>.</span>
</font></center>
</body>
</html>

