1
0

juke 1.1 KB

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