From 579d1c6df085bb8f3e1269d91f050afe359ce1b0 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Wed, 12 Mar 2025 13:33:23 -0600 Subject: [PATCH] create: destroy -f if failed to create --- usr/local/share/bastille/create.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 54a00668..f99ad4b0 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -429,7 +429,7 @@ create_jail() { if [ -f "${bastille_releasesdir}/${RELEASE}/${files}" ] || [ -d "${bastille_releasesdir}/${RELEASE}/${files}" ]; then if ! cp -a "${bastille_releasesdir}/${RELEASE}/${files}" "${bastille_jail_path}/${files}"; then ## notify and clean stale files/directories - bastille destroy "${NAME}" + bastille destroy -af "${NAME}" error_exit "Failed to copy release files. Please retry create!" fi fi @@ -484,7 +484,7 @@ create_jail() { if [ "$?" -ne 0 ]; then ## notify and clean stale files/directories - bastille destroy "${NAME}" + bastille destroy -af "${NAME}" error_exit "Failed release base replication. Please retry create!" fi fi @@ -493,7 +493,7 @@ create_jail() { cp -a "${bastille_releasesdir}/${RELEASE}/" "${bastille_jail_path}" if [ "$?" -ne 0 ]; then ## notify and clean stale files/directories - bastille destroy "${NAME}" + bastille destroy -af "${NAME}" error_exit "Failed to copy release files. Please retry create!" fi fi @@ -560,7 +560,7 @@ create_jail() { # Exit if jail was not started, except for empty jails if [ -z "${EMPTY_JAIL}" ]; then if ! check_target_is_running "${NAME}"; then - bastille destroy "${NAME}" + bastille destroy -af "${NAME}" error_exit "[${NAME}]: Failed to create jail..." fi fi