Skip to content

Commit

Permalink
Update tcpx.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ylx2016 authored Feb 23, 2024
1 parent b3c8292 commit aef5c4e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tcpx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ check_empty() {

#检查磁盘空间
check_disk_space() {
# 检查是否存在 bc 命令
if ! command -v bc &> /dev/null; then
echo "安装 bc 命令..."
# 检查系统类型并安装相应的 bc 包
if [ -f /etc/redhat-release ]; then
yum install -y bc
elif [ -f /etc/debian_version ]; then
apt-get update
apt-get install -y bc
else
echo "无法确定系统类型,请手动安装 bc 命令。"
return 1
fi
fi

# 获取当前磁盘剩余空间
available_space=$(df -h / | awk 'NR==2 {print $4}')

Expand All @@ -208,7 +223,6 @@ check_disk_space() {
fi
}


#安装BBR内核
installbbr() {
kernel_version="5.9.6"
Expand Down

0 comments on commit aef5c4e

Please sign in to comment.