From a67f1a75b0bbd5b4db2505fcd7415227af32d0c2 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:02:08 +0800 Subject: [PATCH] Update check_kernal.sh --- scripts/check_kernal.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check_kernal.sh b/scripts/check_kernal.sh index e115ca7..788f5b9 100644 --- a/scripts/check_kernal.sh +++ b/scripts/check_kernal.sh @@ -22,7 +22,8 @@ check_config(){ # 检查硬盘大小 total_disk=$(df -h / | awk '/\//{print $2}') - total_disk_num=$(echo $total_disk | sed 's/G//') + total_disk_num=$(echo $total_disk | sed -E 's/([0-9.]+)([GT])/\1 \2/') + total_disk_num=$(awk '{printf "%.0f", $1 * ($2 == "T" ? 1024 : 1)}' <<< "$total_disk_num") if [ "$total_disk_num" -lt 20 ]; then _red "本机配置不满足最低要求:至少20G硬盘" _red "本机硬盘配置无法安装PVE"