aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-zblock-cache
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-06-14 20:50:09 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-06-14 20:50:09 +0300
commite667f1e583dda2b9d5a13cd520fdcd0acb627519 (patch)
tree290c959b32f7fff68ba6a6bfe1405f59c74a438c /bin/ak-zblock-cache
parent59ac2791e57066c3fd75e34f6dd037583eba71b9 (diff)
downloadarching-kaos-tools-e667f1e583dda2b9d5a13cd520fdcd0acb627519.tar.gz
arching-kaos-tools-e667f1e583dda2b9d5a13cd520fdcd0acb627519.tar.bz2
arching-kaos-tools-e667f1e583dda2b9d5a13cd520fdcd0acb627519.zip
Making sure we get the return codes and display appropriate messages wherever needed
Diffstat (limited to 'bin/ak-zblock-cache')
-rwxr-xr-xbin/ak-zblock-cache11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/ak-zblock-cache b/bin/ak-zblock-cache
index 6d11cde..cb0d48f 100755
--- a/bin/ak-zblock-cache
+++ b/bin/ak-zblock-cache
@@ -16,11 +16,20 @@ then
ak-zblock-show "$1" > $AK_ZBLOCKDIR/$1
fi
logit "[INFO]" "No cache found. Caching..."
+ ak-zblock-show "$1"
+ if [ "$?" -ne "0" ]
+ then
+ logit "[ERROR]" "ak-zblock-show failed..."
+ exit 1
+ fi
ak-zblock-show "$1" > $AK_ZBLOCKDIR/$1
+ else
+ logit "[ERROR]" "Could not find zblock $1..."
+ exit 1
fi
exit 0
else
- echo not ok
+ printf "Usage:\n\t%s <zblock-ipfs-hash>\n" "$PROGRAM" 1>&2
exit 1
fi