aboutsummaryrefslogtreecommitdiff
path: root/bin/9fs
blob: a89a8f6c439d486994e955a4212b6356ddafa1d9 (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
#!/usr/local/plan9/bin/rc

if(! ~ $#* 1){
	echo 'usage: 9fs sysname'
	exit usage
}

fn srv1 {
	if(! 9p stat $1 >/dev/null >[2=1]){
		rm -f $ns/$1
		srv -a $2 $1
	}
}

ns=`{namespace}
switch($1){
case tip
	srv1 tip utumno.tip9ug.jp
case sources
	srv1 sources sources.cs.bell-labs.com
case *
	srv1 $1 $1
}