#!/bin/sh
#
# NAME
#     tswakeup - make a hidden Biff window visible 
#
# SYNOPSIS
#     tswakeup &
#
# AUTHOR: 
#     Jan-Henrik Haukeland, hauk@tildeslash.com
#
# CVS INFO
#     $Id: tswakeup.sh,v 1.4 1999/11/28 06:02:56 hauk Exp $


# We respect JAVA_HOME if it's defined. But please note, JAVA_HOME
# must point to a jdk1.1.7x version *not* a jdk1.2 version. (The swing
# packages in jdk1.2 have to many bugs that affects the tsbiff
# program) 
if [ -z "${JAVA_HOME}" ] ; then
        echo "JAVA_HOME environment variable not set." 1>&2 
        exit 1
else 
    CLASSPATH=${JAVA_HOME}/lib/classes.zip
fi

TS_HOME=`dirname ${0}`/..
PRG_NAME=`basename ${0}`

TS_JAR=${TS_HOME}/lib/tsbiff.jar
SWING_JAR=${TS_HOME}/lib/swing.jar


# --------------------------------------------------------------------- #


if [ -f "${TS_JAR}" ] ; then
	CLASSPATH=${CLASSPATH}:${TS_JAR}
else
	echo "Could not find tsbiff classes in ${TS_JAR}" 1>&2 
	exit 1
fi



if [ -f "${SWING_JAR}" ] ; then
	CLASSPATH=${CLASSPATH}:${SWING_JAR}
else
	echo "Could not find swing classes in ${SWING_JAR}" 1>&2 
	exit 1
fi

# --------------------------------------------------------------------- #

WAKEUP_CMD="${JAVA_HOME}/bin/java -mx8m -classpath ${CLASSPATH} \
             ts.biff.WakeUpClient"

# --------------------------------------------------------------------- #

case "$1" in
  -h|--help|help)
        echo "Usage: ${PRG_NAME} - make a hidden Biff window visible"
	exit 0
        ;;
  *)
	exec ${WAKEUP_CMD}
        ;;
esac

exit 0
