From 99386e1d4574a49ea87096d21042ea2bda12ac6c Mon Sep 17 00:00:00 2001
From: Sergey Yakubov <sergey.yakubov@desy.de>
Date: Mon, 4 Oct 2021 15:12:43 +0200
Subject: [PATCH] fix start script for win

---
 tests/automatic/common_scripts/start_services.bat | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/automatic/common_scripts/start_services.bat b/tests/automatic/common_scripts/start_services.bat
index ae99389a1..459fa99a0 100644
--- a/tests/automatic/common_scripts/start_services.bat
+++ b/tests/automatic/common_scripts/start_services.bat
@@ -4,6 +4,7 @@ c:\opt\consul\nomad run discovery.nmd
 ping 192.0.2.1 -n 1 -w 3000 > nul
 
 set i=0
+set started=0
 :repeat
 set /a i=%i%+1
 echo %i%
@@ -12,11 +13,12 @@ if %i% EQU 20 (
 )
 ping 192.0.2.1 -n 1 -w 1000 >nul
 curl --silent --fail 127.0.0.1:8400/asapo-discovery/asapo-mongodb --stderr - | findstr 127.0.0.1  || goto :repeat
-if %i% EQU 1 (
+if %started% EQU 0 (
     c:\opt\consul\nomad run authorizer.nmd
     c:\opt\consul\nomad run receiver_tcp.nmd
     c:\opt\consul\nomad run broker.nmd
     c:\opt\consul\nomad run file_transfer.nmd
+    set started=1
     ping 192.0.2.1 -n 1 -w 3000 > nul
 )
 curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | findstr 127.0.0.1  || goto :repeat
-- 
GitLab