X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=blobdiff_plain;f=jpctb;h=e04b95682e39124f03c11e7540da67341a9448bc;hp=24b3268f13ecd19afcc0accf9e054ca6d5743100;hb=3e215518c4173eeb037f7b6247513a980636fb6d;hpb=86b3ff3ab527ca9d4cbcc7e9b7d9c0fd69b3afa9 diff --git a/jpctb b/jpctb index 24b3268..e04b956 100755 --- a/jpctb +++ b/jpctb @@ -24,7 +24,7 @@ usage () { cat <&2 "jpctb: $*" exit 127 } +badusage () { + fail "bad usage: $*" +} -if [ $# -lt 2 ]; then usage; fail 'bad usage'; exit 127; fi +while [ $# -ge 1 ]; do + case "$1" in + -) shift; break;; + --jpctb) + shift + srcjardir="$1" + shift || badusage "--jpctb needs a value" + ;; + -*) badusage "unknown option \`$1'" + ;; + *) + break + esac +done + +if [ $# -lt 1 ]; then usage; badusage "need path to yohoho"; exit 127; fi -srcjardir="$1"; shift yohoho="$1"; shift #---------- find ourselves ---------- @@ -48,16 +65,25 @@ case "$jpctbdir" in *) jpctbdir="$PWD/$jpctbdir" ;; esac +if [ x"$srcjardir" = x ]; then + srcjardir="$jpctbdir" +fi + #---------- find YPP client and the Java installation it uses ---------- yppdir="${yohoho%/*}" +openjdk=/usr/lib/jvm/java-6-openjdk + if [ -x "$yppdir/java/bin/java" ]; then javadir="$yppdir/java" elif [ x"$JAVA_HOME" != x ] && [ -x "$JAVA_HOME/bin/java" ]; then javadir="$JAVA_HOME" +elif [ -x $openjdk/bin/java ]; then + javadir=$openjdk else - fail "could not find java runtime system" + fail "could not find java runtime system + please check that $yppdir/java points to your Java installation" fi case "$javadir" in @@ -80,6 +106,10 @@ jpctb: jpctb tmpdir: "$jtmp" END +#---------- run the control panel ---------- + +"$javadir/bin/java" -jar "$srcjardir/PCTB-ControlPanel.jar" + #---------- create the temporary are and link farm ---------- rm -rf -- "$jtmp"