]> Sergey Matveev's repositories - sgmon.git/blobdiff - run.sh
Ability to have shebangless run-s
[sgmon.git] / run.sh
diff --git a/run.sh b/run.sh
index 13ff28e8a32547c0165a149fc29532a18b11ce15..4bfc1a29c49cff600c28257ea79bbf7e9383ba5d 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -12,7 +12,8 @@ ln -s $SGMONTMP state
 while : ; do
     [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=1
     [ -s state/attempts ] && read attempts < state/attempts || attempts=0
-    if ./run >state/stdout 2>state/stderr ; then
+    [ -x run ] && cmd=./run || cmd="sh -e run"
+    if $cmd >state/stdout 2>state/stderr ; then
         if [ "$attempts" -ge "$max_attempts" ] ; then
             "$SGMONDIR"/notify-ok.sh
         fi