about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xlrep9
1 files changed, 9 insertions, 0 deletions
diff --git a/lrep b/lrep
index 4a98148..b71fd83 100755
--- a/lrep
+++ b/lrep
@@ -91,3 +91,12 @@ while line = gets
     puts line
   end
 end
+
+if pid
+  n = 0
+  until Process.waitpid(pid, Process::WNOHANG)
+    Process.kill(n > 10 ? "KILL" : "TERM", pid)
+    sleep 0.1
+    n += 1
+  end
+end