summaryrefslogtreecommitdiff
path: root/sys/src/games/music/juke.rc
blob: f06961ee2ca56fd82c4cd9d9d8c41655a6d484f8 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/rc

wide=`{echo $vgasize | sed 's/(.*)x.*x.*/\1 > 240/' | hoc}

debug=0
tflag=''
wflag=''
host=''
kb=4096
flags=()
sname=$user
if (! ~ $wide 1) {
	flags=($flags -t)
	kb=1024
}
while(! ~ $#* 0) {
	switch ($1) {
	case -d
		debug=$2
		shift
	case -t
		tflag='-t'
	case -h
		host=$2
		shift
	case -w
		wflags='-w'
	case -s
		sname=$2
		shift
	case -*
		echo Usage: classical [-d level] [-t] [-h srvhost]
		exit usage
	}
	shift
}
if (! test -e /mnt/playlist){
	if (! ~ $debug '0') echo mounting playlistfs
	if (! test -e /srv/playlist.$sname && ! ~ $host ''){
		import -a $host /srv /srv
	}
	if (! mount -b /srv/playlist.$sname /mnt >/dev/null >[2]/dev/null){
		rm -f /srv/playlist.$sname
		if (! ~ $debug '0') echo starting playlistfs
		games/playlistfs -s $sname -d $debug
	}
}
if (! test -w /mnt/juke) {
	if (! test -e /srv/jukefs.$sname && ! ~ $host ''){
		import -a $host /srv /srv
	}
	if (! mount -b /srv/jukefs.$sname /mnt >/dev/null >[2]/dev/null){
		if (! ~ $debug '0') echo games/jukefs
		games/jukefs -s $sname
	}
}
if (~ $wflags '-w') {
	exec games/jukebox -w -d $debug $tflag &
}
exec games/jukebox -d $debug $tflag