From ae883e8ed02f3cb91b6f53e50f3569bb14a4893d Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Mon, 18 Feb 2019 11:32:20 +0100 Subject: [PATCH] Use mktemp for keepfile and rm it after usage (Fix #9) --- lib/bkctld-rm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bkctld-rm b/lib/bkctld-rm index 6770c57..1e79a36 100755 --- a/lib/bkctld-rm +++ b/lib/bkctld-rm @@ -22,7 +22,7 @@ echo "${$}" > "${pidfile}" for jail in $("${LIBDIR}/bkctld-list"); do incs=$(ls "${INCDIR}/${jail}") if [ -f "${CONFDIR}/${jail}" ]; then - keepfile="${CONFDIR}/.keep-${jail}" + keepfile="$(mktemp)" while read j; do date=$( echo "${j}" | cut -d. -f1 ) before=$( echo "${j}" | cut -d. -f2 ) @@ -41,6 +41,7 @@ for jail in $("${LIBDIR}/bkctld-list"); do end=$(date +"%H:%M:%S") notice "${jail} : deleted ${j} inc [${start}/${end}]" done + rm "${keepfile}" fi done rmdir "${empty}"