Add signal arg to kill_bg test util
@@ -6,15 +6,18 @@ function echo_run( )
$@
}
+# arg 1: PID
+# arg 2 (optional): signal (default: 9)
function kill_bg( )
{
PID=$1
CMD=$(ps -p $PID -o cmd=)
SUDO=
TOKILL=$PID
+ SIGNAL=${2:-9}
if [[ ${CMD:0:5} == "sudo " ]] ; then
SUDO="sudo "
TOKILL=$(ps --ppid $PID -o pid=)
fi
- echo_run ${SUDO}kill -9 $TOKILL
+ echo_run ${SUDO}kill -$SIGNAL $TOKILL
}
