22#
33# Command Line Interface to start all services associated with the Fast/Micro-RTPS tutorials
44#
5- # For this tutorial the commands are merely a convenience script to run docker-compose
6- #
5+ # For this tutorial the commands are merely a convenience script to run ${dockerCmd}#
76
87set -e
98
109stoppingContainers () {
1110 echo " Stopping running containers"
12- docker-compose -f docker-compose/kurento-with-filters.yml down -v --remove-orphans
11+ ${dockerCmd} -f docker-compose/kurento-with-filters.yml down -v --remove-orphans
1312}
1413startingContainers () {
1514 echo -e " Starting containers: - \033[1;35mKurento\033[0m and \033[1mKurento-Examples (${command} )\033[0m"
1615 echo -e " - \033[1;35mKurento\033[0m is a Media Server"
1716 echo -e " - \033[1mKurento-Examples\033[0m displays a web app to access the web-cam"
1817 echo " "
19- TUTORIAL_NAME=${command} docker-compose -f docker-compose/kurento-with-filters.yml up -d --remove-orphans
18+ TUTORIAL_NAME=${command} ${dockerCmd} -f docker-compose/kurento-with-filters.yml up -d --remove-orphans
2019 echo " "
2120 echo -e " Now open \033[4mhttps://localhost:8443\033[0m"
2221}
2322
2423
2524
26- if (( $# != 1 )) ; then
27- echo " Illegal number of parameters"
25+ dockerCmd=" docker compose"
26+ if (( $# == 2 )) ; then
27+ dockerCmd=" docker-compose"
28+ fi
29+
30+ if (( $# < 1 )) ; then echo " Illegal number of parameters"
2831 echo " usage: services [start|stop|create]"
2932 exit 1
3033fi
@@ -41,7 +44,7 @@ case "${command}" in
4144 echo -e " - \033[1;35mKurento\033[0m is a Media Server"
4245 echo -e " - \033[1mKurento-Examples\033[0m displays a web app to access the web-cam"
4346 echo " "
44- docker-compose -f docker-compose/kurento.yml up -d --remove-orphans
47+ ${dockerCmd} -f docker-compose/kurento.yml up -d --remove-orphans
4548 echo " "
4649 echo -e " Now open \033[4mhttps://localhost:8443\033[0m"
4750 ;;
@@ -56,7 +59,7 @@ case "${command}" in
5659 " hello-world" )
5760 stoppingContainers;
5861 echo -e " Starting containers: - \033[1;35mKurento\033[0m and \033[1mKurento-Examples (hello-world)\033[0m"
59- docker-compose -f docker-compose/kurento.yml up -d --remove-orphans
62+ ${dockerCmd} -f docker-compose/kurento.yml up -d --remove-orphans
6063 echo " "
6164 echo -e " Now open \033[4mhttps://localhost:8443\033[0m"
6265 ;;
@@ -92,7 +95,7 @@ case "${command}" in
9295 export $( cat .env | grep " #" -v)
9396 echo " Pulling Docker images"
9497 docker pull curlimages/curl
95- docker-compose -f docker-compose/kurento.yml pull
96- docker-compose -f docker-compose/kurento-with-filters.yml pull
98+ ${dockerCmd} -f docker-compose/kurento.yml pull
99+ ${dockerCmd} -f docker-compose/kurento-with-filters.yml pull
97100 ;;
98101esac
0 commit comments