diff options
Diffstat (limited to 'bin/ak-calculate-size')
-rwxr-xr-x | bin/ak-calculate-size | 9 |
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" |