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
wide=`{echo $vgasize | sed 's/(.*)x.*x.*/\1 > 240/' | hoc}
4
 
5
debug=0
6
tflag=''
7
wflag=''
8
host=''
9
kb=4096
10
flags=()
11
sname=$user
12
if(! ~ $wide 1){
13
	flags=($flags -t)
14
	kb=1024
15
}
16
while(! ~ $#* 0){
17
	switch($1){
18
	case -d
19
		debug=$2
20
		shift
21
	case -t
22
		tflag='-t'
23
	case -h
24
		host=$2
25
		if(! ~ $snameset yes)
26
			sname=$2
27
		shift
28
	case -w
29
		wflag='-w'
30
	case -s
31
		snameset=yes
32
		sname=$2
33
		shift
34
	case -*
35
		echo Usage: classical [-d level] [-t] [-h srvhost]
36
		exit usage
37
	}
38
	shift
39
}
40
if(! test -e /mnt/playlist){
41
	if(! ~ $debug 0) echo mounting playlistfs
42
	if(~ $sname linux){
43
		rm -f /srv/playlist.$sname.$user
44
		if (! ~ $debug '0') echo starting playlistfs
45
		games/playlistfs -s $sname.$user -d $debug
46
	}
47
	if not {
48
		if (! test -e /srv/playlist.$sname && ! ~ $host ''){
49
			if (! ~ $debug '0') echo import srv from $host
50
			import -a $host /srv /srv
51
		}
52
		if (! ~ $debug '0') echo mount /srv/playlist.$sname
53
		if (! mount -b /srv/playlist.$sname /mnt >/dev/null >[2]/dev/null){
54
			rm -f /srv/playlist.$sname
55
			if (! ~ $debug '0') echo starting playlistfs
56
			games/playlistfs -s $sname -d $debug
57
		}
58
	}
59
}
60
if (! test -w /mnt/juke) {
61
	if (! test -e /srv/jukefs.$host && ! ~ $host ''){
62
		if (! ~ $debug '0') echo import srv from $host
63
		import -a $host /srv /srv
64
	}
65
	if (! ~ $debug '0') echo mount /srv/jukefs.$user
66
	if (! mount -b /srv/jukefs.$user /mnt >/dev/null >[2]/dev/null){
67
	    if (! mount -b /srv/jukefs.$host /mnt >/dev/null >[2]/dev/null){
68
		if (! ~ $debug '0') echo games/jukefs
69
		games/jukefs -s $user
70
	    }
71
	}
72
}
73
exec games/jukebox $wflag -d $debug $tflag