From d4ddae11d37862e5c659ae15914996b52e16ed75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Pervill=C3=A9?= Date: Thu, 23 Feb 2017 10:28:16 +0100 Subject: [PATCH] Fixes to calc_bytes unit detection --- borg_exporter | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/borg_exporter b/borg_exporter index 6fafa93..5346099 100755 --- a/borg_exporter +++ b/borg_exporter @@ -27,7 +27,7 @@ function calc_bytes { UNIT=$2 case "$UNIT" in - KB) + kB) echo $NUM | awk '{ print $1 * 1024 }' ;; MB) @@ -36,6 +36,9 @@ function calc_bytes { GB) echo $NUM | awk '{ print $1 * 1024 * 1024 * 1024 }' ;; + TB) + echo $NUM | awk '{ print $1 * 1024 * 1024 * 1024 * 1024 }' + ;; esac }