Last active
July 17, 2018 06:47
-
-
Save valentinconan/d28776a12fd64d4538122e8fbfda40f5 to your computer and use it in GitHub Desktop.
Revisions
-
valentinconan revised this gist
Jun 23, 2017 . No changes.There are no files selected for viewing
-
valentinconan created this gist
Jun 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ :label echo start timeout 5 REM replace COMMAND by your command for /f "delims=" %%i in ('COMMAND') do set _string=%%i rem --- Remove whitespace at left for /F "tokens=*" %%s in ("%_string%") do set _trimmed=%%s echo off echo [%_trimmed%] if not %_trimmed% == "healthy" goto label echo on echo end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # sampleBat A sample of a bat use Example of a "while" use Launch a command and get the result to make some processing Trim the string result