2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-09-28 04:52:38 +02:00
|
|
|
|
2018-08-03 02:14:46 +02:00
|
|
|
if { [ "$ZULIP_USER_CREATION_ENABLED" == "True" ] || [ "$ZULIP_USER_CREATION_ENABLED" == "true" ]; } && \
|
|
|
|
{ [ -z "$ZULIP_USER_DOMAIN" ] || \
|
|
|
|
[ -z "$ZULIP_USER_EMAIL" ] || \
|
|
|
|
[ -z "$ZULIP_USER_FULLNAME" ] || \
|
|
|
|
[ -z "$ZULIP_USER_PASS" ]; }; then
|
2017-09-28 04:52:38 +02:00
|
|
|
echo "No zulip user configuration given."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
set +e
|
2019-01-16 04:37:02 +01:00
|
|
|
sudo -H -u zulip -g zulip /home/zulip/deployments/current/manage.py create_user --this-user-has-accepted-the-tos --realm "$ZULIP_USER_DOMAIN" --password "$ZULIP_USER_PASS" "$ZULIP_USER_EMAIL" "$ZULIP_USER_FULLNAME"
|
|
|
|
sudo -H -u zulip -g zulip /home/zulip/deployments/current/manage.py knight "$ZULIP_USER_EMAIL" -f
|