Add the .bat script for start/stop discovery
[msb/discovery.git] / sdclient / discovery-standalone / src / assembly / resources / discover / find_kill_process.bat
diff --git a/sdclient/discovery-standalone/src/assembly/resources/discover/find_kill_process.bat b/sdclient/discovery-standalone/src/assembly/resources/discover/find_kill_process.bat
new file mode 100644 (file)
index 0000000..8241c5f
--- /dev/null
@@ -0,0 +1,24 @@
+@REM\r
+@REM Copyright (C) 2018 ZTE, Inc. and others. All rights reserved. (ZTE)\r
+@REM\r
+@REM Licensed under the Apache License, Version 2.0 (the "License");\r
+@REM you may not use this file except in compliance with the License.\r
+@REM You may obtain a copy of the License at\r
+@REM\r
+@REM         http://www.apache.org/licenses/LICENSE-2.0\r
+@REM\r
+@REM Unless required by applicable law or agreed to in writing, software\r
+@REM distributed under the License is distributed on an "AS IS" BASIS,\r
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+@REM See the License for the specific language governing permissions and\r
+@REM limitations under the License.\r
+@REM\r
+\r
+echo %1 | findstr %2 | findstr %3>NUL\r
+echo ERRORLEVEL=%ERRORLEVEL%\r
+IF ERRORLEVEL 1 goto findend\r
+for /f "tokens=1" %%a in (%1) do (  \r
+    echo kill %1\r
+       taskkill /F /pid %%a\r
+)\r
+:findend
\ No newline at end of file