From a53a43583cf1f674ca33f6b2f2c3a1d4ff0b9b21 Mon Sep 17 00:00:00 2001 From: Kevin McGrath Date: Sun, 4 Jan 2015 14:03:04 -0500 Subject: [PATCH] AWS Linux aware Check for AWS Linux. If lsb_release does not exist check /etc/system-release to see if the OS is Amazon Linux. If it is, set OS to "AmazonAMI". --- bin/haproxy-marathon-bridge | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/haproxy-marathon-bridge b/bin/haproxy-marathon-bridge index c9ac9290f29..6b05f710647 100755 --- a/bin/haproxy-marathon-bridge +++ b/bin/haproxy-marathon-bridge @@ -55,8 +55,16 @@ function refresh_system_haproxy { } function install_haproxy_system { - os=$(lsb_release -si) - if [[ $os == "CentOS" ]] || [[ $os == "RHEL" ]] + + if hash lsb_release 2>/dev/null + then + os=$(lsb_release -si) + elif [ -e "/etc/system-release" ] && (grep -q "Amazon Linux AMI" "/etc/system-release") + then + os="AmazonAMI" + fi + + if [[ $os == "CentOS" ]] || [[ $os == "RHEL" ]] || [[ $os == "AmazonAMI" ]] then sudo yum install -y haproxy sudo chkconfig haproxy on