From 7584dc72e7bb4d42fa8452a1d897765a61c5b1d2 Mon Sep 17 00:00:00 2001 From: Anathema Date: Thu, 18 Aug 2011 11:01:17 +0200 Subject: [PATCH] added support for the --force option, which cause slam_tomb() to not wait 3 secs between kills --- src/tomb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tomb b/src/tomb index dde2611..fccbd14 100755 --- a/src/tomb +++ b/src/tomb @@ -767,7 +767,6 @@ kill_tomb() { # so we can get a for loop honestly e=(${(s: :)e}) for p in $e; do - echo "p $p" func "killing PID $p..." if [[ "$2" == "soft" ]]; then kill -USR1 $p @@ -797,7 +796,9 @@ slam_tomb() { return 0 fi - sleep 3 + # if we set the -f (force) option + # don't wait, just kill + option_is_set -f || sleep 3 kill_tomb "$pidk" "hard" pidk=`lsof -t "$1"` if [[ -z "$pidk" ]]; then @@ -806,7 +807,7 @@ slam_tomb() { # if there are still some pids around # we have to kill 'em all - sleep 3 + option_is_set -f || sleep 3 kill_tomb "$pidk" "must die" pidk=`lsof -t "$1"` if [[ -z "$pidk" ]]; then