Skip to content

Commit

Permalink
feat: Update jicofo start script to check for config.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Oct 15, 2024
1 parent eb53e19 commit 1b37d90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
10 changes: 9 additions & 1 deletion resources/jicofo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
if [[ "$1" == "--help" ]]; then
echo -e "Usage: $0"
echo
echo -e "Supported environment variables: JICOFO_AUTH_PASSWORD, JICOFO_MAX_MEMORY, JAVA_SYS_PROPS."
echo -e "Supported environment variables: JICOFO_MAX_MEMORY, JAVA_SYS_PROPS."
echo
exit 1
fi

if [[ ! "$JAVA_SYS_PROPS" == *"-Dconfig.file="* ]]; then
echo
echo "To run jicofo you need a configuration file. Use environment variable JAVA_SYS_PROPS."
echo "e.g. export JAVA_SYS_PROPS=\"-Dconfig.file=/etc/jitsi/jicofo/jicofo.conf\""
echo
exit 2
fi

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"

mainClass="org.jitsi.jicofo.Main"
Expand Down
20 changes: 9 additions & 11 deletions resources/mvn-exec.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/sh -e

readonly CONFIG=$1
if [ -z ${CONFIG+x} -o ! -f $1 ]; then
echo 'Config file missing.'
exit 1
#!/bin/bash -e

if [[ ! "$JAVA_SYS_PROPS" == *"-Dconfig.file="* ]]; then
echo
echo "To run jicofo you need a configuration file. Use environment variable JAVA_SYS_PROPS."
echo "e.g. export JAVA_SYS_PROPS=\"-Dconfig.file=/etc/jitsi/jicofo/jicofo.conf\""
echo
exit 2
fi

. $CONFIG

export JICOFO_AUTH_PASSWORD

exec mvn compile exec:exec -Dexec.executable=java -Dexec.args="-cp %classpath ${JAVA_SYS_PROPS} org.jitsi.jicofo.Main --domain=\"${JICOFO_HOSTNAME}\" --host=\"${JICOFO_HOST}\" --user_domain=\"${JICOFO_AUTH_DOMAIN}\" --user_name=\"${JICOFO_AUTH_USER}\""
exec mvn ${JAVA_SYS_PROPS} compile exec:java -pl jicofo -Dexec.mainClass=org.jitsi.jicofo.Main

0 comments on commit 1b37d90

Please sign in to comment.