diff --git a/services/scripts/run_server_image.sh b/services/scripts/run_server_image.sh --- a/services/scripts/run_server_image.sh +++ b/services/scripts/run_server_image.sh @@ -2,8 +2,8 @@ set -e -if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then - echo "Illegal number of parameters, expected:" +if [[ "$#" -lt 1 ]] || [[ "$#" -gt 2 ]]; then + echo "Illegal number of arguments, expected 2:" echo "- one argument with a name of the service, currently available services:" ./scripts/list_services.sh echo "- one optional argument with port" @@ -12,16 +12,16 @@ fi SERVICE=$1 -if [ "$SERVICE" == "tunnelbroker" ]; then - if [ ! -z "$2" ]; then +if [[ "$SERVICE" == "tunnelbroker" ]]; then + if [[ -n "$2" ]]; then export COMM_SERVICES_PORT_TUNNELBROKER=$2 fi -elif [ "$SERVICE" == "backup" ]; then - if [ ! -z "$2" ]; then +elif [[ "$SERVICE" == "backup" ]]; then + if [[ -n "$2" ]]; then export COMM_SERVICES_PORT_BACKUP=$2 fi -elif [ "$SERVICE" == "blob" ]; then - if [ ! -z "$2" ]; then +elif [[ "$SERVICE" == "blob" ]]; then + if [[ -n "$2" ]]; then export COMM_SERVICES_PORT_BLOB=$2 fi else @@ -29,5 +29,5 @@ exit 1 fi -docker-compose build $SERVICE-server -docker-compose up $SERVICE-server +docker-compose build "$SERVICE"-server +docker-compose up "$SERVICE"-server