Merge pull request #1073 from BastilleBSD/tschettervictor-patch-2

This commit is contained in:
tschettervictor
2025-05-17 10:17:21 -06:00
committed by GitHub

View File

@@ -295,14 +295,17 @@ migrate_jail() {
# Destroy old jail if OPT_DESTROY=1
if [ "${OPT_DESTROY}" -eq 1 ]; then
bastille destroy -af "${_jail}"
bastille destroy -afy "${_jail}"
fi
# Remove archives
migrate_cleanup "${_jail}" "${_user}" "${_host}" "${_port}"
# Start new jail if AUTO=1
if [ "${AUTO}" -eq 1 ]; then
# Reconcile LIVE and AUTO, ensure only one side is running
if [ "${AUTO}" -eq 1 ] && [ "${LIVE}" -eq 0 ]; then
${_sshpass_cmd} ssh -p ${_port} ${_opt_ssh_key} ${_user}@${_host} ${OPT_SU} bastille start "${_jail}"
elif [ "${AUTO}" -eq 1 ] && [ "${LIVE}" -eq 1 ]; then
bastille stop "${_jail}"
${_sshpass_cmd} ssh -p ${_port} ${_opt_ssh_key} ${_user}@${_host} ${OPT_SU} bastille start "${_jail}"
fi
}