From b84d0fc1a307f6103ea2c2620a106db821696434 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 2 Apr 2019 01:11:22 +0800 Subject: Add proper process teminate method --- editors/code/src/utils/terminateProcess.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 editors/code/src/utils/terminateProcess.sh (limited to 'editors/code/src/utils/terminateProcess.sh') diff --git a/editors/code/src/utils/terminateProcess.sh b/editors/code/src/utils/terminateProcess.sh new file mode 100644 index 000000000..2ec9e1c2e --- /dev/null +++ b/editors/code/src/utils/terminateProcess.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +terminateTree() { + for cpid in $(pgrep -P $1); do + terminateTree $cpid + done + kill -9 $1 > /dev/null 2>&1 +} + +for pid in $*; do + terminateTree $pid +done \ No newline at end of file -- cgit v1.2.3