Skip to content

Instantly share code, notes, and snippets.

@bobelev
bobelev / haconfig.sh
Created January 14, 2016 18:05 — forked from jlazic/haconfig.sh
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: etckeeper, diffcolor
#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
#should start using it.
#Script assumes following directory structure:
#/etc/haproxy/conf.d/
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-key update
apt-get update
# Go to local source directory