#!/bin/bash
set -x

echo "UC_PORT: ${UC_PORT}"
echo "WS_PORT: ${WS_PORT}"

# shellcheck disable=SC2044
for FILE in $(find /etc/nginx/conf.d/*); do
    sed -i -e "s|UC_PORT|${UC_PORT}|" -e "s|WS_PORT|${WS_PORT}|" "${FILE}"
done

/usr/sbin/nginx
sh
