bigbluebutton-Github/labs/docker/kurento/docker-entrypoint.sh

26 lines
1015 B
Bash
Raw Normal View History

#!/bin/bash -e
apt-get install -y openh264-gst-plugins-bad-1.5
rm -f /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
2019-02-02 04:29:27 +08:00
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$STUN_IP" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$STUN_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
2019-02-02 04:29:27 +08:00
if [ "$TURN_URL" != "" ]; then
echo "turnURL=$TURN_URL" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
2019-02-02 04:29:27 +08:00
rm -f /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
# Generate BaseRtpEndpoint configuration
echo "minPort=$RTP_MIN_PORT" >> /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
echo "maxPort=$RTP_MAX_PORT" >> /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini
2019-02-02 04:29:27 +08:00
CONFIG=$(cat /etc/kurento/kurento.conf.json | sed '/^[ ]*\/\//d' | jq ".mediaServer.net.websocket.port = $PORT")
echo $CONFIG > /etc/kurento/kurento.conf.json
# Remove ipv6 local loop until ipv6 is supported
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
exec "$@"