From: Sergey Matveev Date: Sun, 27 Mar 2022 09:48:47 +0000 (+0300) Subject: Ability to have shebangless run-s X-Git-Url: http://www.git.stargrave.org/?p=sgmon.git;a=commitdiff_plain;h=30a887466756a732c8d2b5022faed5e2c0a89add Ability to have shebangless run-s --- diff --git a/README b/README index 8454efe..87ad8dc 100644 --- a/README +++ b/README @@ -9,28 +9,21 @@ Create some directory hierarchy for convenience: Make probes from them: - $ cat > probes/example.com/ping4/run < probes/example.com/ping4/run < probes/example.com/http/max-attempts - $ cat > probes/example.com/ping4/run < probes/example.com/ping4/run - $ cat > probes/example.com/ping6/run < probes/example.com/ping6/run $ echo 5 > probes/example.com/ping4/period # every 5 seconds $ cat > probes/jails/foobar/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