From 03f26cbb7f8b7361e0cd76cff94e641160b3f484 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 5 May 2025 21:42:17 -0600 Subject: [PATCH] migrate: Add config var if not present in bastille.conf --- usr/local/share/bastille/migrate.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/local/share/bastille/migrate.sh b/usr/local/share/bastille/migrate.sh index 19565471..f5d8b232 100644 --- a/usr/local/share/bastille/migrate.sh +++ b/usr/local/share/bastille/migrate.sh @@ -133,8 +133,11 @@ migrate_create_export() { # Ensure migrate directory is in place ## ${bastille_migratedir} if [ -z "${bastille_migratedir}" ]; then - error_notify "[ERROR]: No migrate directory found." - error_exit "Did you diff the config file?" + if ! grep -oq "bastille_migratedir=" "${BASTILLE_CONFIG}"; then + sed -i '' 's|bastille_backupsdir=.*|&\nbastille_migratedir=\"${bastille_prefix}/migrate\" ## default: \"${bastille_prefix}/migrate\"|' ${BASTILLE_CONFIG} + # shellcheck disable=SC1090 + . ${BASTILLE_CONFIG} + fi fi if [ ! -d "${bastille_migratedir}" ]; then if checkyesno bastille_zfs_enable; then