# HG changeset patch # User Xerxes R?nby # Date 1302085563 -7200 # Node ID 4a42266b1c65ebc1b81b75bb766b202c4b666784 # Parent bd66068b1c3f3098f15b4748fb7175785d507c88 tools/ika: Launch wrapper for ika to be used from users path. * tools/ika: Launch wrapper for ika to be used from users path. diff -r bd66068b1c3f -r 4a42266b1c65 tools/ika --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/ika Wed Apr 06 12:26:03 2011 +0200 @@ -0,0 +1,53 @@ +#! /bin/sh +## + # IKA - IcedRobot Kiosk Application + # Copyright (C) 2011 IcedRobot team + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation, either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + ## + +ika_exec_args="$@" + +if [ -z "$IKA_HOME" -o ! -d "$IKA_HOME" ] ; then + if [ -d /usr/share/ika ] ; then + IKA_HOME=/usr/share/ika + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + JAVACMD="$JAVA_HOME/bin/java" + else + JAVACMD=`which java 2> /dev/null ` + if [ -z "$JAVACMD" ] ; then + JAVACMD=java + fi + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + +if [ ! -x "$IKA_HOME" ] ; then + echo "Error: IKA_HOME is not defined correctly." + echo " We cannot find $IKA_HOME" + exit 1 +fi + +ika_exec_command="exec \"$JAVACMD\" \ + -jar \"$IKA_HOME\"/target/ika-0.0.1-SNAPSHOT-jar-with-dependencies.jar" +eval $ika_exec_command "$ika_exec_args"