From 9f3bf1110105487a65903fcf2d1ece97e822e0ea Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 9 Jun 2018 12:29:48 +0900 Subject: [PATCH] Update comments elrepo-kernel repository is enabled by default Signed-off-by: Teddysun --- bbr.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bbr.sh b/bbr.sh index 68b1bb7..ec2d111 100644 --- a/bbr.sh +++ b/bbr.sh @@ -276,7 +276,7 @@ install_bbr() { check_bbr_status if [ $? -eq 0 ]; then echo - echo -e "${green}Info:${plain} TCP BBR has been installed. nothing to do..." + echo -e "${green}Info:${plain} TCP BBR has already been installed. nothing to do..." exit 0 fi check_kernel_version @@ -290,7 +290,9 @@ install_bbr() { if [[ x"${release}" == x"centos" ]]; then install_elrepo - yum --enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel + [ ! "$(command -v yum-config-manager)" ] && yum install -y yum-utils > /dev/null 2>&1 + [ x"$(yum-config-manager elrepo-kernel | grep -w enabled | awk '{print $3}')" != x"True" ] && yum-config-manager --enable elrepo-kernel > /dev/null 2>&1 + yum -y install kernel-ml kernel-ml-devel if [ $? -ne 0 ]; then echo -e "${red}Error:${plain} Install latest kernel failed, please check it." exit 1