Use printf(%d) to avoid CentOS using floats.

This commit is contained in:
Daniel Nichter
2012-02-02 12:13:00 -07:00
parent 7be99c5140
commit 9c6b9ab33d

View File

@@ -50,8 +50,8 @@ check_disk_space() {
local bytes_margin="${4:-0}"
# Real/actual bytes used and bytes free.
local used_bytes=$(cat "$file" | awk '/^\//{print $3 * 1024}');
local free_bytes=$(cat "$file" | awk '/^\//{print $4 * 1024}');
local used_bytes=$(cat "$file" | awk '/^\//{printf("%d",$3 * 1024)}');
local free_bytes=$(cat "$file" | awk '/^\//{printf("%d",$4 * 1024)}');
local pct_used=$(cat "$file" | awk '/^\//{print $5}' | sed -e 's/%//g');
local pct_free=$((100 - $pct_used))