Skip to content

Commit

Permalink
core: 查询不到准确内存时使用 free 兜底
Browse files Browse the repository at this point in the history
fixes #179
  • Loading branch information
bin456789 committed Oct 18, 2024
1 parent 0d4a9ee commit f7ac7c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,12 @@ check_ram() {
fi
fi

# 用于兜底,不太准确
if [ -z $ram_size ]; then
ram_size=$(free -m | grep ^Mem: | awk '{print $2}')
ram_size=$((ram_size + 64 + 4))
fi

if [ -z $ram_size ] || [ $ram_size -le 0 ]; then
error_and_exit "Could not detect RAM size."
fi
Expand Down

0 comments on commit f7ac7c5

Please sign in to comment.