10-config 1009 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/with-contenv bash
  2. if [[ ! -f /config/sip-communicator.properties ]]; then
  3. cp /defaults/sip-communicator.properties /config
  4. sed -i \
  5. -e "s,\${XMPP_DOMAIN},$XMPP_DOMAIN,g" \
  6. -e "s,\${XMPP_AUTH_DOMAIN},$XMPP_AUTH_DOMAIN,g" \
  7. -e "s,\${JICOFO_AUTH_USER},$JICOFO_AUTH_USER,g" \
  8. -e "s#\${JVB_STUN_SERVERS}#$JVB_STUN_SERVERS#g" \
  9. /config/sip-communicator.properties
  10. fi
  11. if [[ ! -f /config/logging.properties ]]; then
  12. cp /defaults/logging.properties /config
  13. fi
  14. # Do this for every run, since the local IP may change!
  15. if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then
  16. LOCAL_ADDRESS=$(hostname -I | cut -d " " -f1)
  17. sed -i \
  18. -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$LOCAL_ADDRESS," \
  19. -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$DOCKER_HOST_ADDRESS," \
  20. /config/sip-communicator.properties
  21. fi