Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
rfork en
4
 
5
if(! ~ $#libreplica 1)
6
	libreplica=$home/lib/replica
7
 
8
fn usage {
9
	echo 'usage: replica/setupdirs' >[1=2]
10
	exit usage
11
}
12
 
13
fn fatal {
14
	echo $* >[1=2]
15
	exit $"*
16
}
17
 
18
fn must {
19
	$* || fatal $"*^': '^$status
20
}
21
 
22
if(! ~ $#* 0)
23
	usage
24
 
25
for (i in \
26
	$libreplica\
27
	$libreplica/db\
28
	$libreplica/db/client\
29
	$libreplica/db/server\
30
	$libreplica/log\
31
	$libreplica/cfg)
32
	if(! test -d $i)
33
		must mkdir -p $i
34