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