Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chadfurman/ced2c00bbd7a4072a25deaded7b32684 to your computer and use it in GitHub Desktop.
Save chadfurman/ced2c00bbd7a4072a25deaded7b32684 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Get envs from environment and echo them
echo "Updating janus config files using variables from ENVIRONMENT"
## rewrite needed configurations
sed -i "s/wss_port = 8989;/wss_port = ${JANUS_SIGNAL_PORT};/" /opt/janus/etc/janus/janus.transport.websockets.cfg
sed -i "s/admin_secure_port = 7889/admin_secure_port = ${JANUS_ADMIN_PORT}/" /opt/janus/etc/janus/janus.transport.http.cfg
sed -i "s/rtp_port_range = 20000-40000/rtp_port_range = ${JANUS_RTP_RANGE}/" /opt/janus/etc/janus/janus.cfg
sed -i "s/api_secret = vcast_j4nus/api_secret = ${JANUS_SIGNAL_PASSWORD}/" /opt/janus/etc/janus/janus.cfg
sed -i "s/admin_secret = asdf/admin_secret = ${JANUS_ADMIN_PASSWORD}/" /opt/janus/etc/janus/janus.cfg
## start janus, passing through the remaining args
/opt/janus/bin/janus $@ 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment