10-config 951 B

123456789101112131415161718192021222324
  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,\${JICOFO_AUTH_USER},$JICOFO_AUTH_USER,g" \
  7. -e "s#\${JVB_STUN_SERVERS}#$JVB_STUN_SERVERS#g" \
  8. /config/sip-communicator.properties
  9. fi
  10. if [[ ! -f /config/logging.properties ]]; then
  11. cp /defaults/logging.properties /config
  12. fi
  13. # Do this for every run, since the local IP may change!
  14. if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then
  15. LOCAL_ADDRESS=$(hostname -I | cut -d " " -f1)
  16. sed -i \
  17. -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$LOCAL_ADDRESS," \
  18. -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$DOCKER_HOST_ADDRESS," \
  19. /config/sip-communicator.properties
  20. fi