summaryrefslogtreecommitdiff
path: root/rc/bin/juke
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 17:14:36 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 17:14:36 +0300
commit2959e1ede0ebc6fdffd7b8660f43c2ce14c9696f (patch)
treef6343b1ce11a8c87251dd27cf3d3e26b50693fa7 /rc/bin/juke
parente463eb40363ff4c68b1d903f4e0cdd0ac1c5977f (diff)
downloadplan9front-2959e1ede0ebc6fdffd7b8660f43c2ce14c9696f.tar.xz
Import sources from 2011-03-30 iso image - rc
Diffstat (limited to 'rc/bin/juke')
-rwxr-xr-xrc/bin/juke60
1 files changed, 60 insertions, 0 deletions
diff --git a/rc/bin/juke b/rc/bin/juke
new file mode 100755
index 000000000..f06961ee2
--- /dev/null
+++ b/rc/bin/juke
@@ -0,0 +1,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