summaryrefslogtreecommitdiffstats
path: root/sup
diff options
context:
space:
mode:
Diffstat (limited to 'sup')
-rwxr-xr-xsup20
1 files changed, 20 insertions, 0 deletions
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
+