diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-06-06 22:04:51 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-06-06 22:04:51 +0200 |
commit | 3bbb7a400a253f776e60eff44a386c898eb8014d (patch) | |
tree | 4b03b61e87f632bcab97842a2c2d5e6a58afb427 | |
parent | 30e977cc418e8e71a0e9da239573fae46990a45a (diff) | |
download | bin-3bbb7a400a253f776e60eff44a386c898eb8014d.tar.gz bin-3bbb7a400a253f776e60eff44a386c898eb8014d.tar.xz |
add sup (simple supervisor)
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-x | sup | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 + |