vps/coturn/coturn-docker-entrypoint.sh
2023-12-08 16:45:50 +01:00

17 lines
421 B
Bash
Executable file

#!/bin/bash
# If command starts with an option, prepend it with a `turnserver` binary.
if [ "${1:0:1}" == '-' ]; then
set -- turnserver "$@"
fi
# Evaluate each argument separately to avoid mixing them up in a single `eval`.
expanded=()
for i in "$@"; do
expanded+=("$(eval "echo $i")")
done
cp /etc/coturn/server.conf /tmp/turnserver.conf
cat /etc/coturn/secret.conf >> /tmp/turnserver.conf
exec "${expanded[@]}"