aboutsummaryrefslogtreecommitdiff
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
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
-rwxr-xr-xbin/ak-ipfs-cat4
-rwxr-xr-xbin/ak-zblock-cache11
2 files changed, 14 insertions, 1 deletions
diff --git a/bin/ak-ipfs-cat b/bin/ak-ipfs-cat
index e1e6491..b9bd7ec 100755
--- a/bin/ak-ipfs-cat
+++ b/bin/ak-ipfs-cat
@@ -1,3 +1,7 @@
#!/bin/bash
ipfs --timeout=10s cat $1
+if [ "$?" -ne "0" ]
+then
+ exit 1
+fi
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