Update cattools.sh

This commit is contained in:
喵二
2024-07-29 00:14:43 +08:00
committed by GitHub
parent 8ed99374e1
commit 524131ea7f

View File

@@ -901,8 +901,12 @@ sysupgrade() {
echo "" echo ""
disk_size=$(fdisk -l /dev/sda | grep "Disk /dev/sda:" | awk '{print $3}') tolerance=$(echo "200/1024/1024" | bc -l)
if (($(echo "$disk_size != 800.28" | bc -l))); then allowed_size=800.28
min_size=$(echo "$allowed_size - $tolerance" | bc -l)
max_size=$(echo "$allowed_size + $tolerance" | bc -l)
if (($(echo "$disk_size < $min_size" | bc -l))) || (($(echo "$disk_size > $max_size" | bc -l))); then
echo "[Error] 磁盘空间出现过修改或不匹配,无法继续升级。" echo "[Error] 磁盘空间出现过修改或不匹配,无法继续升级。"
exit 1 exit 1
fi fi