From d8e1ce9fb186d18ea44240dd1474932afe8ff6a5 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 29 Jun 2021 17:19:02 +0200 Subject: [PATCH] bkctld-remove: force mode bypass inexisting jail --- lib/bkctld-remove | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/bkctld-remove b/lib/bkctld-remove index 94d6b19..def4e74 100755 --- a/lib/bkctld-remove +++ b/lib/bkctld-remove @@ -16,7 +16,14 @@ fi jail_path=$(jail_path "${jail_name}") incs_path=$(incs_path "${jail_name}") -test -d "${jail_path}" || error "${jail_name}: jail not found" 2 +if ! test -d "${jail_path}"; then + if [ "${FORCE}" = "1" ]; then + warning "${jail_name}: jail not found (ignore in FORCE mode)" + exit 0 + else + error "${jail_name}: jail not found" 2 + fi +fi if [ "${FORCE}" != "1" ]; then answer=""