From fd21a5dafbfc32009641c78b18300e18083055bd Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Fri, 14 Jul 2023 09:06:40 +0200 Subject: [PATCH] =?utf8?q?Dodano=20sume=20rozpakowanych=20kontener=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- get_image_size | 3 +++ 1 file changed, 3 insertions(+) diff --git a/get_image_size b/get_image_size index 4897e78..07ee8b3 100755 --- a/get_image_size +++ b/get_image_size @@ -11,11 +11,14 @@ function get_image_size() { total=$(echo "$total + $float_size" | bc -l); echo "$remote = $image_size"; done + csize_total=$(echo "$(cut -d ";" -f 2 $1 | grep '^[0-9\.]*' | awk '{printf $1" "}' | sed -s 's/ /+/g')0" | bc -l); if [ $(echo $total | cut -d "." -f 1) -gt 1024 ]; then total=$(echo "$total / 1024" | bc -l | cut -c 1-4); + csize_total=$(echo "$csize_total / 1024" | bc -l | cut -c 1-4); size_suffix="GB"; fi echo "Total: ${total}${size_suffix}"; + echo "Aprox. container size: ${csize_total}${size_suffix}"; } get_image_size $filename; -- 2.39.5