Back (Current repo: terraform-mariadb-replica-homelab)

A terraform homelab with mariadb and maxscale for my own understanding and learning.
To clone this repository:
git clone https://git.viktor1993.net/terraform-mariadb-replica-homelab.git
Log | Download | Files | Refs | README

destroy_in_batch.sh (484B)


#!/bin/bash

BATCH_NAME=$1
THIS_BATCH=$2
WORKING_DIR=$3
NUMBER=$4
TEMPLATE_DIR=$5
BATCH_REGISTRY=$6

if [ ! -d "${THIS_BATCH}" ]; then
	echo "Error: Batch ${BATCH_NAME} not found"
	exit 1
fi

if [ ! -d "${WORKING_DIR}" ]; then
    echo "Error: Batch ${BATCH_NAME} has no template dir!"
    exit 1
fi

echo "Destroying batch: ${BATCH_NAME}"
cd ${WORKING_DIR} && make OPERATION=DESTROY NUMBER=${NUMBER}
sed -i "/^${BATCH_NAME}:/d" ${BATCH_REGISTRY}
echo "Batch destroyed successfully!"