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

delete_batch_dir.sh (430B)


#!/bin/bash

BATCH_NAME=$1
THIS_BATCH=$2
TEMPLATE_DIR=$3
BATCH_REGISTRY=$4

if [ ! -d "${THIS_BATCH}" ]; then
	echo "Error: Batch ${BATCH_NAME} not found!"
	exit 1;
fi
echo "Removing batch directory: ${THIS_BATCH}"
read -p "Are you sure? [y/N] " CONFIRM;
if [ "$CONFIRM" = "y" ] || [ "$CONFIRM" = "Y" ]; then
	rm -rf ${THIS_BATCH};
	sed -i "/^${BATCH_NAME}:/d" ${BATCH_REGISTRY}
	echo "Batch removed!";
else
	echo "Cancelled";
fi