1#!/bin/sh 2 3ROOT_PID=$1 4SIGNAL=$2 5 6terminateTree() { 7 for cpid in $(pgrep -P $1); do 8 terminateTree $cpid 9 done 10 kill -$SIGNAL $1 > /dev/null 2>&1 11} 12 13terminateTree $ROOT_PID 14 15