2021-01-16 15:33:16 +00:00
|
|
|
#!/bin/bash -e
|
2014-12-08 02:59:37 +00:00
|
|
|
set -e
|
|
|
|
|
2021-01-16 15:28:34 +00:00
|
|
|
data_dir_owner="$(stat -c %u "/var/lib/prosody/")"
|
|
|
|
if [[ "$(id -u prosody)" != "$data_dir_owner" ]]; then
|
|
|
|
usermod -u "$data_dir_owner" prosody
|
|
|
|
fi
|
|
|
|
if [[ "$(stat -c %u /var/run/prosody/)" != "$data_dir_owner" ]]; then
|
|
|
|
chown "$data_dir_owner" /var/run/prosody/
|
|
|
|
fi
|
2020-02-13 00:10:36 +00:00
|
|
|
|
2016-02-04 19:19:17 +00:00
|
|
|
if [[ "$1" != "prosody" ]]; then
|
2021-03-21 19:16:33 +00:00
|
|
|
exec prosodyctl "$@"
|
2016-02-04 19:19:17 +00:00
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
2021-01-16 15:33:16 +00:00
|
|
|
if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then
|
2019-03-16 18:19:37 +00:00
|
|
|
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
|
2014-12-08 02:59:37 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-21 19:57:07 +00:00
|
|
|
exec setpriv --reuid=prosody --regid=prosody --init-groups "$@"
|