]> Sergey Matveev's repositories - sgmon.git/blobdiff - run.sh
tlsc has modern TLS implementation
[sgmon.git] / run.sh
diff --git a/run.sh b/run.sh
index 4bfc1a29c49cff600c28257ea79bbf7e9383ba5d..a8120ff6b6358f0961010a6592def526d51cfe41 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -4,13 +4,14 @@ export SGMONDIR="$(dirname "$(realpath -- "$0")")"
 . "$SGMONDIR"/rc
 [ -z "$1" ] && SGMONSRV="$(basename "$PWD")" || SGMONSRV="$1"
 export SGMONSRV
-export SGMONTMP=`mktemp -d -t sgmon`
-trap "rm -fr $SGMONTMP" HUP PIPE INT QUIT TERM EXIT
+mkdir -p /tmp/sgmon
+export SGMONTMP=`TMPDIR=/tmp/sgmon mktemp -d -t sgmon`
 rm -f state
 ln -s $SGMONTMP state
+trap "rm -fr state $SGMONTMP" HUP PIPE INT QUIT TERM EXIT
 
 while : ; do
-    [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=1
+    [ -s max-attempts ] && read max_attempts < max-attempts || max_attempts=$ATTEMPTS_DEFAULT
     [ -s state/attempts ] && read attempts < state/attempts || attempts=0
     [ -x run ] && cmd=./run || cmd="sh -e run"
     if $cmd >state/stdout 2>state/stderr ; then