]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Dodano sume rozpakowanych kontenerów
authorxf0r3m <jakubstasinski@protonmail.com>
Fri, 14 Jul 2023 07:06:40 +0000 (09:06 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Fri, 14 Jul 2023 07:06:40 +0000 (09:06 +0200)
get_image_size

index 4897e783734090328ee965d5b888304ddf929176..07ee8b381c7f360085654ca8fd7dba3d57f2b84d 100755 (executable)
@@ -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;