migrate: Add config var if not present in bastille.conf

This commit is contained in:
tschettervictor
2025-05-05 21:42:17 -06:00
committed by GitHub
parent eb1bce2289
commit 03f26cbb7f

View File

@@ -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