2022-01-15 10:16:39 +00:00
|
|
|
#!/bin/sh
|
2023-10-29 14:05:16 +00:00
|
|
|
set -eu
|
2022-01-15 10:16:39 +00:00
|
|
|
|
2023-12-22 18:34:37 +00:00
|
|
|
# Correct permissions where needed.
|
|
|
|
chown -R coturn:coturn /var/lib/coturn
|
|
|
|
|
2022-01-15 10:16:39 +00:00
|
|
|
# Prepare configuration files for environment variable substitution.
|
2023-12-22 17:54:13 +00:00
|
|
|
ENV_NAMES="$(env | awk -F '=' '{printf "$%s ", $1}')"
|
2022-01-15 10:16:39 +00:00
|
|
|
for file in /etc/coturn/*.template; do
|
2023-12-22 17:54:13 +00:00
|
|
|
envsubst "$ENV_NAMES" < "$file" > "${file%.template}"
|
2022-01-15 10:16:39 +00:00
|
|
|
done
|
|
|
|
|
2023-12-30 17:13:32 +00:00
|
|
|
exec /usr/bin/turnserver -c /etc/coturn/turnserver.conf
|