#!/bin/sh
set -vx
#
# This script installs the latest verion of TLISA.
# Visit http://astro.uni-tuebingen.de/~TLISA for information.
#
# last modified: 23-Mar-2015 11:25:20
#
#
# Set TLISA shell variables
#
# please enter the following path if not appropriate
export TLISAHOME="/home/${LOGNAME}/GAVO/TLISA"
#
export TLISALVER='15w02b-d'
export TLISA='java -jar ${TLISAHOME}/TLISA.jar'
#
# Create TLISA directories
if test ! -s ${TLISAHOME}
then
  mkdir  ${TLISAHOME}
fi
mkdir ${TLISAHOME}
if test ! -s ${TLISAHOME}/plugins
then
  mkdir ${TLISAHOME}/plugins
fi
if test ! -s ${TLISAHOME}/configs
then
  mkdir ${TLISAHOME}/configs
fi
if test ! -s ${TLISAHOME}/lib
then
  mkdir ${TLISAHOME}/lib
fi
#
# Download the latest TLISA version
cd ${TLISAHOME}
cd ..
wget http://astro.uni-tuebingen.de/~TLISA/downloads/TLISA-${TLISALVER}.zip
#
ls -l TLISA-${TLISALVER}.zip
unzip TLISA-${TLISALVER}.zip
cd  ${TLISAHOME}
ln -sf TLISA-${TLISALVER}.jar TLISA.jar
ls -l TLISA.jar
#
echo "Latest version of TLISA has been installed."
echo 'Please use "TLISA" to start.'
