1#!/bin/bash
2
3if [[ "$1" == "--help"  || $# -lt 1 ]]; then
4    echo -e "Usage:"
5    echo -e "$0 [OPTIONS], where options can be:"
6    echo -e "\t--host=HOST\t sets the hostname of the XMPP server (default: domain, if domain is set, localhost otherwise)"
7    echo -e "\t--domain=DOMAIN\t sets the XMPP domain"
8    echo -e "\t--port=PORT\t sets the port of the XMPP server (default: 5347)"
9    echo -e "\t--subdomain=SUBDOMAIN\t sets the sub-domain used to bind focus XMPP component (default: focus)"
10    echo -e "\t--secret=SECRET\t sets the shared secret used to authenticate focus component to the XMPP server"
11    echo -e "\t--user_domain=DOMAIN\t specifies the name of XMPP domain used by the focus user to login."
12    echo -e "\t--user_name=USERNAME\t specifies the username used by the focus XMPP user to login. (default: focus@user_domain)"
13    echo -e "\t--user_password=PASSWORD\t specifies the password used by focus XMPP user to login. If not provided then focus user will use anonymous authentication method."
14    echo
15    exit 1
16fi
17
18SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
19
20mainClass="org.jitsi.jicofo.Main"
21cp=$(JARS=($SCRIPT_DIR/jicofo*.jar $SCRIPT_DIR/lib/*.jar); IFS=:; echo "${JARS[*]}")
22logging_config="$SCRIPT_DIR/lib/logging.properties"
23
24# if there is a logging config file in lib folder use it (running from source)
25if [ -f $logging_config ]; then
26    LOGGING_CONFIG_PARAM="-Djava.util.logging.config.file=$logging_config"
27fi
28
29exec java -Xmx3072m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp $LOGGING_CONFIG_PARAM $JAVA_SYS_PROPS -cp $cp $mainClass $@
30