No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tsock_video 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. puits=false
  3. sourc=false
  4. protocol="tcp"
  5. port=`expr \`id -u\` % 3000 + 14578`
  6. usage() { echo "Usage: $0 [[-p|-s] [-t (tcp|mictcp)]" 1>&2; exit 1; }
  7. while getopts "pst:" o; do
  8. case "${o}" in
  9. t)
  10. protocol=${OPTARG}
  11. if [ "$protocol" != "tcp" ] && [ "$protocol" != "mictcp" ]; then
  12. usage
  13. exit 1
  14. fi
  15. ;;
  16. p)
  17. puits=true
  18. ;;
  19. s)
  20. sourc=true
  21. ;;
  22. *)
  23. usage
  24. ;;
  25. esac
  26. done
  27. if ([ "$puits" = true ] && [ "$sourc" = true ]) || ([ "$puits" = false ] && [ "$sourc" = false ]) ; then
  28. usage
  29. exit 1
  30. fi
  31. if [ "$puits" = true ]; then
  32. echo "Lancement du puits, protocole " $protocol
  33. cvlc rtp://127.0.0.1:$port > /dev/null 2>&1 &
  34. if [ "$protocol" = "mictcp" ]; then
  35. cd build
  36. ./gateway -p -t $protocol $port &
  37. cd ..
  38. fi
  39. fi
  40. if [ "$sourc" = true ]; then
  41. echo "Lancement de la source, protocol " $protocol
  42. cd build
  43. ./gateway -s -t $protocol 127.0.0.1 $port &
  44. cd ..
  45. fi
  46. echo "Appuyez sur ENTREE pour arreter"
  47. read line
  48. echo "Arret"
  49. killall -9 cvlc > /dev/null 2>&1
  50. killall -9 vlc > /dev/null 2>&1
  51. killall -9 gateway > /dev/null 2>&1