From 8f033e59201e972c703de7bac72a088fe4ba1153 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 17 Aug 2024 10:34:34 +0200 Subject: [PATCH] Add failure check to execute sysctl --- installers/common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index aeb270b5..7c490a06 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -826,12 +826,12 @@ function _configure_tcp_bbr() { fi # Apply the sysctl changes echo "Applying changes" - sudo sysctl -p + sudo sysctl -p || _install_status 1 "Unable to execute sysctl" # Verify if BBR is enabled - current_cc=$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}') - if [ "$current_cc" == "bbr" ]; then - echo "TCP BBR has been successfully enabled" + cc=$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}') + if [ "$cc" == "bbr" ]; then + echo "TCP BBR successfully enabled" else _install_status 1 "Failed to enable TCP BBR" fi