#!/bin/bash

# $Id: setupCyteSeer 20801 2012-02-28 19:35:05Z esuparno $

####################################################################################
#
# Program Name: setupCyteSeer
# Engineer:	Erwin Suparno
# Date:		7/15/2009
#
# Description:	This program is to setup current user Java UserPrefs and
#		Desktop shortcut
#
####################################################################################

### source /etc/init.d/functions for [OK] & [FAILED] functions
. /etc/init.d/functions

# the CyteSeer Program
PROGNAME="CyteSeer"
PROGHOME="/usr/local/$PROGNAME"
CYTESEER="\"$PROGHOME/$PROGNAME\""

checkCyteSeerExist() {
#######################################
####    checkCyteSeerExist 
### purpose: checks if CyteSeer is installed 
##  created by: esuparno 07/15/2009
#   updated by: esuparno 01/12/2010
############################
if [ ! -e "$PROGHOME/jilaunch" ]; then 
        echo "CyteSeer is not found, please install it as root (superuser) and re-run this program\!" && echo_failure
        echo
        exit 1
fi
}

createDesktopShortcut() {
#######################################
####    createDesktopShortcut
### purpose: create Desktop Shortcut for current user
##  created by: esuparno 07/15/2009
#   updated by: esuparno 01/12/2010
############################
echo "    *********"
echo "Creating new user skeleton CyteSeer Desktop shortcut..."
cat <<EOF > $HOME/Desktop/CyteSeer.desktop && echo_success || echo_failure
[Desktop Entry]
Comment=CyteSeer for DeltaVision
Exec=$CYTESEER
GenericName=CyteSeer for DeltaVision
GenericName[en_US]=CyteSeer for DeltaVision
Icon=$PROGHOME/Vala-icon.png
Name=CyteSeer for DeltaVision
Type=Application
EOF
}



################
# MAIN
################
checkCyteSeerExist
createDesktopShortcut
# EOF

