2011-03-30 14:14:36 +00:00
|
|
|
#!/bin/rc
|
2012-05-26 19:50:10 +00:00
|
|
|
rfork e
|
2011-03-30 14:14:36 +00:00
|
|
|
wide=`{echo $vgasize | sed 's/(.*)x.*x.*/\1 > 240/' | hoc}
|
|
|
|
debug=0
|
|
|
|
tflag=''
|
|
|
|
wflag=''
|
|
|
|
host=''
|
|
|
|
flags=()
|
|
|
|
sname=$user
|
|
|
|
if (! ~ $wide 1) {
|
|
|
|
flags=($flags -t)
|
|
|
|
}
|
|
|
|
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 -*
|
2020-03-10 17:09:34 +00:00
|
|
|
echo usage: juke [-d level] [-tw] [-s srv] [-h srvhost] >[1=2]
|
2011-03-30 14:14:36 +00:00
|
|
|
exit usage
|
|
|
|
}
|
|
|
|
shift
|
|
|
|
}
|
2012-05-25 05:12:05 +00:00
|
|
|
if (! test -f /mnt/playlist) {
|
2011-03-30 14:14:36 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
2012-05-25 05:12:05 +00:00
|
|
|
if (~ `{ls /mnt/juke >[2]/dev/null | sed '1q'} '') {
|
2011-03-30 14:14:36 +00:00
|
|
|
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
|