aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-06-15 19:47:29 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-06-15 19:47:29 +0300
commit01ff1c0a97cd36e69e21bac0776bef21be7ae374 (patch)
treee7756bdf0d04dbfc5ebd862f412c60ffccd605c3
parentff23bc03e5f9f3b08d7d7d60fb33614ad48f9637 (diff)
downloadarching-kaos-tools-01ff1c0a97cd36e69e21bac0776bef21be7ae374.tar.gz
arching-kaos-tools-01ff1c0a97cd36e69e21bac0776bef21be7ae374.tar.bz2
arching-kaos-tools-01ff1c0a97cd36e69e21bac0776bef21be7ae374.zip
Fixed script call and one bug
-rwxr-xr-xbin/ak-calculate-size9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/ak-calculate-size b/bin/ak-calculate-size
index 45fa5fa..63ae2f7 100755
--- a/bin/ak-calculate-size
+++ b/bin/ak-calculate-size
@@ -1,8 +1,13 @@
#!/bin/bash
-extract-cids > to_stats
+ak-extract-cids > to_stats
sum=0 ; while IFS="" read -r p || [ -n "$p" ]
do
- num=$(ak-ipfs-block-stat $p | grep Size | sed -e 's/Size: //g')
+ if [ "$p" != "" ]
+ then
+ num=$(ak-ipfs-block-stat $p | grep Size | sed -e 's/Size: //g')
+ else
+ num=0
+ fi
sum=$(expr $sum + $num )
done < to_stats
echo "Chain is : $sum bytes"