forked from evolix/evocheck
Use python instead of bc to get percentage of reserved blocks
bc is not installed on all servers.
This commit is contained in:
parent
3453423579
commit
f90b1d9e71
|
@ -499,7 +499,7 @@ if [ -e /etc/debian_version ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
reservedBlockCount=$(dumpe2fs -h "$part" 2>/dev/null | grep -e "Reserved block count:" | grep -Eo "[0-9]+")
|
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
|
if [ "$percentage" -lt 5 ]; then
|
||||||
echo 'IS_TUNE2FS_M5 FAILED!'
|
echo 'IS_TUNE2FS_M5 FAILED!'
|
||||||
# Set debug to 1, to displays which partitions has less than 5%
|
# Set debug to 1, to displays which partitions has less than 5%
|
||||||
|
|
Loading…
Reference in a new issue