@@ -7,9 +7,32 @@ if is_installed sniproxy; then
77 pkill -9 sniproxy > /dev/null 2>&1
88fi
99
10- if ! is_installed_package " haproxy=3.1" ; then
11- add-apt-repository -y ppa:vbernat/haproxy-3.1
12- install_package haproxy=3.1.\*
10+ OS_VERSION=$( lsb_release -rs | cut -d' .' -f1)
11+ echo " Detected OS version: Ubuntu $OS_VERSION "
12+
13+ if [ " $OS_VERSION " -eq 22 ]; then
14+ echo " OS version is 22, checking for haproxy=3.0"
15+ if ! is_installed_package " haproxy=3.0" ; then
16+ echo " Adding PPA for haproxy-3.0"
17+ add-apt-repository -y ppa:vbernat/haproxy-3.0
18+ echo " Installing haproxy 3.0"
19+ install_package haproxy=3.0.*
20+ else
21+ echo " haproxy 3.0 is already installed"
22+ fi
23+ elif [ " $OS_VERSION " -eq 24 ]; then
24+ echo " OS version is 24, checking for haproxy=3.1"
25+ if ! is_installed_package " haproxy=3.1" ; then
26+ echo " Adding PPA for haproxy-3.1"
27+ add-apt-repository -y ppa:vbernat/haproxy-3.1
28+ echo " Installing haproxy 3.1"
29+ install_package haproxy=3.1.*
30+ else
31+ echo " haproxy 3.1 is already installed"
32+ fi
33+ else
34+ echo " OS version is neither 22 nor 24, skipping haproxy installation"
35+ exit 1
1336fi
1437systemctl kill haproxy > /dev/null 2>&1
1538systemctl stop haproxy > /dev/null 2>&1
0 commit comments