mirror of
https://github.com/SaraSmiseth/prosody.git
synced 2025-01-18 13:10:37 +00:00
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:
parent
606e63f20f
commit
9645f521f8
1 changed files with 15 additions and 14 deletions
|
@ -1,20 +1,6 @@
|
|||
#!/bin/bash
|
||||
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 DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$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 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 "$@"
|
||||
|
|
Loading…
Reference in a new issue