X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=run.sh;h=4bfc1a29c49cff600c28257ea79bbf7e9383ba5d;hb=30a887466756a732c8d2b5022faed5e2c0a89add;hp=13ff28e8a32547c0165a149fc29532a18b11ce15;hpb=d777a2c50759241792d14fc24a5ed196920f6255;p=sgmon.git diff --git a/run.sh b/run.sh index 13ff28e..4bfc1a2 100755 --- 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