1
0
Fork 0
forked from mirror/prosody

fix bug with env-vars

env-vars should be defined before the if conditional branches, so that
in case they execute, there will be no errors about undefined env-vars
This commit is contained in:
Ubuntu 2020-09-19 23:30:12 +00:00 committed by Sara Aimée Smiseth
parent 606e63f20f
commit 9645f521f8

View file

@ -1,20 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -e
if [[ "$1" != "prosody" ]]; then
exec prosodyctl $*
exit 0;
fi
if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
prosodyctl register $LOCAL $DOMAIN $PASSWORD
fi
if [ -z "$DOMAIN" ]; then
echo "[ERROR] DOMAIN must be set!"
exit 1
fi
export ALLOW_REGISTRATION=${ALLOW_REGISTRATION:-true} export ALLOW_REGISTRATION=${ALLOW_REGISTRATION:-true}
export DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$DOMAIN"} export DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$DOMAIN"}
export DOMAIN_MUC=${DOMAIN_MUC:-"conference.$DOMAIN"} export DOMAIN_MUC=${DOMAIN_MUC:-"conference.$DOMAIN"}
@ -35,4 +21,19 @@ export SERVER_CONTACT_INFO_SECURITY=${SERVER_CONTACT_INFO_SECURITY:-"xmpp:securi
export SERVER_CONTACT_INFO_SUPPORT=${SERVER_CONTACT_INFO_SUPPORT:-"xmpp:support@$DOMAIN"} export SERVER_CONTACT_INFO_SUPPORT=${SERVER_CONTACT_INFO_SUPPORT:-"xmpp:support@$DOMAIN"}
export PROSODY_ADMINS=${PROSODY_ADMINS:-""} export PROSODY_ADMINS=${PROSODY_ADMINS:-""}
if [[ "$1" != "prosody" ]]; then
exec prosodyctl $*
exit 0;
fi
if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
prosodyctl register $LOCAL $DOMAIN $PASSWORD
fi
if [ -z "$DOMAIN" ]; then
echo "[ERROR] DOMAIN must be set!"
exit 1
fi
exec "$@" exec "$@"