]> Sergey Matveev's repositories - sgmon.git/commitdiff
Remove state symlink too
authorSergey Matveev <stargrave@stargrave.org>
Tue, 29 Mar 2022 15:41:09 +0000 (18:41 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 29 Mar 2022 15:45:25 +0000 (18:45 +0300)
run.sh

diff --git a/run.sh b/run.sh
index 4bfc1a29c49cff600c28257ea79bbf7e9383ba5d..3bc7a880afae6d37409f4c72ed488228dc100d20 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -5,9 +5,9 @@ export SGMONDIR="$(dirname "$(realpath -- "$0")")"
 [ -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
 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