#!/bin/sh
# 

# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then 
  . /usr/share/java-utils/java-functions
else
  echo "Can't find functions library, aborting"
  exit 1
fi


MAIN_CLASS=cz.zcu.fav.kiv.editor.controller.MainController




# Load system-wide configuration
if [ -f /etc/fo-editor.conf ]; then
  . /etc/fo-editor.conf
fi

# Load user configuration
[ -f "$HOME/.fo-editorrc" ] && . "$HOME/.fo-editorrc"


# Bail out if there's nothing to run
if [ -z "$MAIN_CLASS" ]
then
	echo "Can not determine main class for '$PROGNAME'" >&2
	exit 1
fi

# Do not forget about RPM dependencies!
BASE_JARS="$BASE_JARS foeditor"
BASE_JARS="$BASE_JARS log4j"

# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTION

# Let's start
run --main "$MAIN_CLASS" "$@"
