#!/bin/sh

BINARY="/usr/lib/tremulous-server/tremded"
BASE_PATH="/usr/share/games/tremulous"
CONFIG_FILE="server.cfg"

# Tremulous binaries don't understand "regular" command line parameters. Let's
# catch them here, to avoid accidently launching the binary.

while [ "$1" != "" ]; do {
	if [ "$1" = "+set" ]; then
		break;
	fi
	case "$1" in
		-h|--help)
			echo -e ${EXCUSE}
			exit 0;
			;;
	esac
}; done

# Ready to rumble!

exec ${BINARY} +set dedicated 2 +set fs_basepath ${BASE_PATH} +exec ${CONFIG_FILE} $*
exit $?
