X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;ds=sidebyside;f=jpctb;h=54c1f41cda4ffc8ff722a087b930853bed9b0407;hb=f5bb97cf8f15c225bec6d30e1fd86fcaf0860df7;hp=7cca6dfb09bb0fad97693a3bc542ae8696544c5a;hpb=65dd16489f28e506b0b9d2c017d165d66c892591;p=jarrg-ian.git diff --git a/jpctb b/jpctb index 7cca6df..54c1f41 100755 --- a/jpctb +++ b/jpctb @@ -43,6 +43,10 @@ badusage () { fail "bad usage: $*" } +check_only=false +setup_only=false +setup_only_simulate='' + while [ $# -ge 1 ]; do case "$1" in -) shift; break;; @@ -51,6 +55,15 @@ while [ $# -ge 1 ]; do srcjardir="$1" shift || badusage "--jpctb needs a value" ;; + --check-only) + check_only=true + shift + ;; + --setup-only) + setup_only=true + setup_only_simulate=echo + shift + ;; -*) badusage "unknown option \`$1'" ;; *) @@ -144,7 +157,23 @@ END #---------- run the control panel ---------- -"$javadir/bin/java" -jar "$srcjardir/PCTB-ControlPanel.jar" +if $check_only; then echo "Check successful."; exit 0; fi + +set +e +$setup_only_simulate "$javadir/bin/java" \ + -Dcom.tedpearson.ypp.market.controlpanel.exitstatus=12 \ + -jar "$srcjardir/PCTB-ControlPanel.jar" +rc=$? +set -e + +if $setup_only; then rc=12; fi + +case $rc in +0) echo "launcher dialogue closed, quitting"; exit 0 ;; +12) ;; +*) echo >&2 "control panel failed with exit status $rc"; exit "$rc" ;; +esac + #---------- create the temporary are and link farm ---------- @@ -205,4 +234,4 @@ chmod +x -- "$wrapper" #---------- now run it ---------- -exec "$yohoho" -Djava.home="$linkfarm/jre" +exec $setup_only_simulate "$yohoho" -Djava.home="$linkfarm/jre"