2018-08-17 11:48:48 +08:00
|
|
|
#!/bin/bash -e
|
2018-07-26 02:14:55 +08:00
|
|
|
|
|
|
|
apt-get install -y openh264-gst-plugins-bad-1.5
|
|
|
|
|
2018-08-17 11:48:48 +08:00
|
|
|
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
|
2018-07-26 02:14:55 +08:00
|
|
|
|
2019-02-02 04:29:27 +08:00
|
|
|
if [ "$TURN_URL" != "" ]; then
|
|
|
|
echo "turnURL=$TURN_URL" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
|
2018-07-26 02:14:55 +08:00
|
|
|
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
|
2018-07-26 02:14:55 +08:00
|
|
|
|
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
|
2018-08-17 11:48:48 +08:00
|
|
|
|
2018-07-26 02:14:55 +08:00
|
|
|
# Remove ipv6 local loop until ipv6 is supported
|
|
|
|
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
|
|
|
|
|
2018-08-17 11:48:48 +08:00
|
|
|
exec "$@"
|