From 3bbb7a400a253f776e60eff44a386c898eb8014d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 6 Jun 2010 22:04:51 +0200 Subject: add sup (simple supervisor) Signed-off-by: Florian Pritz --- sup | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 sup diff --git a/sup b/sup new file mode 100755 index 0000000..9fad081 --- /dev/null +++ b/sup @@ -0,0 +1,20 @@ +#!/bin/sh + +command="$*" + +cleanup() { + echo "killed... $pid" + kill $pid + exit +} + +trap cleanup 2 15 + +while :; do + echo -n "running... " + $command & + pid=$! + echo PID: $pid + wait $pid +done + -- cgit v1.2.3-24-g4f1b