#!/bin/bash
### BEGIN BOOT SCRIPT INFO
#Long-Name: Hercules
### END BOOT SCRIPT INFO
### BEGIN BOOT SCRIPT INSTALLATION DEFAULTS
#Launch-Mode: gui-and-terminal
### END BOOT SCRIPT INSTALLATION DEFAULTS
#
#This script uses a standard run scriptlet called RUN_HERCULES, which is
#optional unless you need to change the Hercules configuration file name by
#setting $HERCULES_CONF, change the RC file by exporting $HERCULES_RC, run
#extra commands before Hercules, or write the console log to a file by
#redirecting the output.
#

. bootscriptfunctions.sh

HERCULES_CONFIG="hercules.cnf"

SCRIPT_ARGS=("$@")

HERCULES_VERSION="$OSM_EMULATOR_VERSION"

run_hercules()
{
	if [ "$HERCULES_VERSION" ]
	then
		HERCULES_VERSION="-$HERCULES_VERSION"
	fi
	exec "hercules$HERCULES_VERSION" \
		-f "$HERCULES_CONF" \
		"${SCRIPT_ARGS[@]}" \
		"$@"
}

OPTIONAL_RUN=1
OPTIONAL_SCRIPTLET=1
call_run_scriptlet hercules
