#!/bin/sh
#  $Id: rcfulltta.sh,v 1.10 2005/06/20 19:15:55 peterc Exp $
#  Copyright (C) 1999-2005 Tarantella, Inc.
#  This software code contains proprietary information 
#  and should be treated as confidential.
#
# chkconfig: @@CHKCONFIG@@
# description: Tarantella Secure Global Desktop

# Start/stop Tarantella

# This file runs the default installation of Tarantella
# This file will be replaced when setup is run
# If you want to make changes to this file, move it to a new
# filename first.

# If you need to be able to make ssh connections when starting
# applications, and if your ssh client program is NOT in one
# of these standard locations:
#   /usr/local/bin/ssh
#   /usr/bin/ssh
#   /usr/sbin/ssh
#   /usr/lbin/ssh
#   /bin/ssh
#   /sbin/ssh
# you should uncomment the TTASSHCLIENT setting below and set 
# it to point to the correct location.
unset TTASSHCLIENT
#TTASSHCLIENT="" export TTASSHCLIENT

# be paranoid about the current path
if [ -d /bin ]; then
  PATH=/bin:$PATH
fi
if [ -d /sbin ]; then
  PATH=/sbin:$PATH
fi
if [ -d /usr/bin ]; then
  PATH=/usr/bin:$PATH
fi
if [ -d /usr/sbin ]; then
  PATH=/usr/sbin:$PATH
fi
if [ -d /etc ]; then
  PATH=/etc:$PATH
fi
export PATH


cwd=`pwd`
cd "@@TTA_DIR@@" >/dev/null 2>&1
TTADIR="@@TTA_DIR@@"
tta_script=@@TTA_SCRIPT@@

lockname=Tarantella
lockdir=/var/lock/subsys
lockfile=${lockdir}/$lockname

if [ -x $tta_script ]; then
  case $1 in
    stop )
	$tta_script stop --quiet
	[ -f $lockfile ] && rm -f $lockfile
	;;
    start )
	$tta_script start
	[ -d $lockdir -a ! -f $lockfile ] && touch $lockfile
	;;
    stop_msg )
	echo "Stop Tarantella"
	;;
    start_msg )
	echo "Start Tarantella"
	;;
    * )
	echo "$0 [start|stop|start_msg|stop_msg]"
	;;
  esac
else
  echo "$0: cannot find $TTADIR/$tta_script" 1>&2
fi

cd $cwd
