From 5324ee063645ffefd47a69fb7b223b8953437987 Mon Sep 17 00:00:00 2001 From: levasseur Date: Fri, 8 Oct 2021 17:40:11 +0200 Subject: [PATCH] fix: erase eventual temporary file in case of error exit; version bump --- init.sh | 2 +- lib/aaa_errors.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/init.sh b/init.sh index ecc6aed..2ad0370 100755 --- a/init.sh +++ b/init.sh @@ -36,7 +36,7 @@ export LC_ALL=C export LANG=C # Version of init -export VERSION="0.99.9" +export VERSION="0.99.10" # Store script's path (realpath -s resolve symlinks if init.sh is a symlink) export MYPATH=$(dirname $(realpath -s $0)) diff --git a/lib/aaa_errors.sh b/lib/aaa_errors.sh index 6d7d110..f350189 100644 --- a/lib/aaa_errors.sh +++ b/lib/aaa_errors.sh @@ -72,6 +72,9 @@ trap "error ${LINENO}; backtrace; err_exit" ERR # Exit program in case of error unless keepgoing is set to true function err_exit { + if [[ -n $tmpfile ]]; then + rm -f $tmpfile + fi if [[ $KEEPGOING != true ]]; then exit 255 fi