10-config 761 B

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