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_maxscale.awk (337B)


#!/bin/awk -f

BEGIN{
    if(number == "") {number = 2;}
    if(boundary == "") {boundary = 6;}
    new = boundary - number;
    pat="\\[server"new"\\]";
}
{
    if($0 ~ pat) {
        flag = 1;
        next;
    }
    if($0 ~ "#") {
        print $0;
        flag = 0;
        next;
    }
    if(flag == 0) {
        print $0;
    }
}