summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Apperly <jim@rabbitmq.com>2012-02-21 12:03:26 +0000
committerJim Apperly <jim@rabbitmq.com>2012-02-21 12:03:26 +0000
commit46f37ecc2c95e5ba58981a5594d44aa76468c5a6 (patch)
treeb5e368dc7e2b0605fe549493e9f30dc84ff73ae6
parent99a273e543b8ba2c82ddd0fa6f72afa1557c151d (diff)
downloadrabbitmq-server-git-46f37ecc2c95e5ba58981a5594d44aa76468c5a6.tar.gz
Handle echopid nit picks
-rw-r--r--scripts/rabbitmq-echopid.bat23
1 files changed, 10 insertions, 13 deletions
diff --git a/scripts/rabbitmq-echopid.bat b/scripts/rabbitmq-echopid.bat
index cc68d0f9e0..0c6f4e15cd 100644
--- a/scripts/rabbitmq-echopid.bat
+++ b/scripts/rabbitmq-echopid.bat
@@ -6,7 +6,7 @@ REM <rabbitmq_nodename> sname of the erlang node to connect to (required)
setlocal
-if "%1"=="" goto wmic_fail
+if "%1"=="" goto fail
:: set the node name ::
set NODENAME="%1"
@@ -18,37 +18,34 @@ set TIMER=1
:: check that wmic exists ::
set WMIC_PATH=%SYSTEMROOT%\System32\Wbem\wmic.exe
if not exist "%WMIC_PATH%" (
- goto wmic_fail
+ goto fail
)
-:: build node name expression ::
-set RABBITMQ_NODENAME_CLI=-sname %1
-
-:wmic_getpid
-for /f "usebackq tokens=* skip=1" %%P IN (`%%WMIC_PATH%% process where "name='erl.exe' and commandline like '%%%RABBITMQ_NODENAME_CLI%%%'" get processid 2^>nul`) do (
+:getpid
+for /f "usebackq tokens=* skip=1" %%P IN (`%%WMIC_PATH%% process where "name='erl.exe' and commandline like '%%-sname %1%%'" get processid 2^>nul`) do (
set PID=%%P
- goto wmic_echopid
+ goto echopid
)
-:wmic_echopid
+:echopid
:: check for pid not found ::
if "%PID%" == "" (
PING 127.0.0.1 -n 2 > nul
set /a TIMER+=1
- if %TIMEOUT%==%TIMER% goto wmic_fail
- goto wmic_getpid
+ if %TIMEOUT%==%TIMER% goto fail
+ goto getpid
)
:: show pid ::
echo %PID%
:: all done ::
-:wmic_ok
+:ok
endlocal
EXIT /B 0
:: something went wrong ::
-:wmic_fail
+:fail
endlocal
EXIT /B 1