Skip to content

Commit

Permalink
fix: check_used value not number
Browse files Browse the repository at this point in the history
  • Loading branch information
lework authored May 12, 2022
1 parent c1ef43c commit 24a53f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion os-check/files/check_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function check_used() {
item=$1
value=${2:-0}

[[ !"$value" =~ ^|0-9|+$ ]] && return
# 忽略小数位,不能数字对比时,直接返回。
[[ ${value%.*} -ge 0 ]] 2>/dev/null || return

if [[ ${value%.*} -ge ${critical_threshold%.*} ]]; then
critical=${critical}'"'${item}'",'
Expand Down

0 comments on commit 24a53f6

Please sign in to comment.