docker-start-turn.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # Copyright Epic Games, Inc. All Rights Reserved.
  3. # Get stun server data for passing to the container
  4. source common_utils.sh
  5. set_start_default_values "n" "y" # Only STUN server defaults
  6. use_args "$@"
  7. localip=$(hostname -I | awk '{print $1}')
  8. echo "Private IP: $localip"
  9. turnport="${turnserver##*:}"
  10. if [ -z "${turnport}" ]; then
  11. turnport=3478
  12. fi
  13. echo "TURN port: ${turnport}"
  14. echo ""
  15. turnusername="PixelStreamingUser"
  16. turnpassword="AnotherTURNintheroad"
  17. realm="PixelStreaming"
  18. process="turnserver"
  19. arguments="-p ${turnport} -r $realm -X $publicip -E $localip -L $localip --no-cli --no-tls --no-dtls --pidfile /var/run/turnserver.pid -f -a -v -n -u ${turnusername}:${turnpassword}"
  20. # Add arguments passed to script to arguments for executable
  21. arguments+=" ${cirruscmd}"
  22. # Start docker container by name using host networking
  23. echo "Running: ${process} ${arguments}"
  24. # Get the docker image
  25. docker pull coturn/coturn
  26. # Start the TURN server
  27. #docker run --name coturn_latest --network host -it --entrypoint /bin/bash coturn/coturn
  28. #docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo mkdir -p /var/run" coturn/coturn ""
  29. #docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/ls" coturn/coturn "/var/"
  30. docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "${process}" coturn/coturn "${arguments}"
  31. #docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/bash" coturn/coturn "ls -latr /var/run/"
  32. #docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo chown ubuntu:ubuntu /var/run/turnserver.pid | sudo chmod +x /var/run/turnserver.pid | ${process}" coturn/coturn "${arguments}"