From f90b1d9e715afc57ccab5b24b628ad9e72b51dff Mon Sep 17 00:00:00 2001 From: Romain Dessort Date: Mon, 2 Oct 2017 16:23:04 -0400 Subject: [PATCH] Use python instead of bc to get percentage of reserved blocks bc is not installed on all servers. --- evocheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index 6784abc..8603456 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -499,7 +499,7 @@ if [ -e /etc/debian_version ]; then continue fi reservedBlockCount=$(dumpe2fs -h "$part" 2>/dev/null | grep -e "Reserved block count:" | grep -Eo "[0-9]+") - percentage=$(bc -l <<< "(${reservedBlockCount}/${blockCount})*100" | awk '{printf("%d\n",$1 + 0.5)}') + percentage=$(python -c "print(int(round(float(${reservedBlockCount})/${blockCount}*100)))") if [ "$percentage" -lt 5 ]; then echo 'IS_TUNE2FS_M5 FAILED!' # Set debug to 1, to displays which partitions has less than 5%