mirror of
https://github.com/Tencent/WeKnora.git
synced 2025-11-25 03:15:00 +08:00
修复bug:脚本检查系统环境时如果操作系统是Darwin,检查内存使用情况输出为空,原因是正则表达式有问题
This commit is contained in:
@@ -538,7 +538,7 @@ check_environment() {
|
|||||||
# 检查内存
|
# 检查内存
|
||||||
log_info "检查内存使用情况..."
|
log_info "检查内存使用情况..."
|
||||||
if [ "$OS" = "Darwin" ]; then
|
if [ "$OS" = "Darwin" ]; then
|
||||||
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages free: (\d+)/ and print "Free Memory: ", $1 * $size / 1048576, " MB\n"'
|
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages free:\s*(\d+)/ and print "Free Memory: ", $1 * $size / 1048576, " MB\n"'
|
||||||
else
|
else
|
||||||
free -h | grep -E "(total|Mem:)"
|
free -h | grep -E "(total|Mem:)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user