Skip to content

Instantly share code, notes, and snippets.

View zzf01's full-sized avatar

Andreas Rizzi zzf01

  • fnxs
View GitHub Profile
@zzf01
zzf01 / haconfig.sh
Last active June 28, 2020 16:51 — forked from jlazic/haconfig.sh
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: etckeeper, colordiff
#Script based on https://gist.github.com/jlazic/e65f5bda141ffaed5640 by Josip Lazić
#Article: https://lazic.info/josip/post/splitting-haproxy-config/
#This script concatenates multiple files of haproxy configuration into
#one file, and than checks if monolithic config contains errors. If everything is
#OK with new config script will write new config to $CURRENTCFG and reload haproxy
#Also, script will commit changes to etckeeper, if you don't use etckeeper you