#!/bin/bash

if [[ $(cat /etc/*-release | grep "Ubuntu") ]]; then
    if !command -v haproxy &>/dev/null; then
        apt install haproxy -y
    fi
    cd /etc/haproxy/
    rm -rf haproxy.cfg
    wget https://cdn.udinweb.com/configs/haproxy.cfg
    systemctl restart haproxy
    echo "Haproxy Installed Successfully!"
else
    echo "This should only be run on ubuntu\n";
    exit 1;
fi