aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_zblock
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-30 07:01:15 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-30 07:01:15 +0300
commit30a2bc6cc950bcd460e5a3651ab869a732a0f50b (patch)
treeff9abace41c2d356301f0fcd72211ee974c7efb9 /lib/_ak_zblock
parent35ddac1871fbbc608417e1b1ec2012bf09687edd (diff)
downloadarching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.gz
arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.bz2
arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.zip
Refactoring
Diffstat (limited to 'lib/_ak_zblock')
-rwxr-xr-xlib/_ak_zblock16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/_ak_zblock b/lib/_ak_zblock
index f853ef7..f379870 100755
--- a/lib/_ak_zblock
+++ b/lib/_ak_zblock
@@ -44,7 +44,7 @@ _ak_zblock_show(){
# We check if any $zblock at all
_ak_ipfs_cat $zblock | jq -c -M > $AK_ZBLOCKDIR/$zblock
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "ZBLOCK $zblock READ failed"
exit 1
@@ -90,14 +90,14 @@ _ak_zblock_show(){
echo -n '"block":"'$block'",'
_ak_ipfs_cat $block | jq -c -M > $AK_BLOCKDIR/$block
cat $AK_BLOCKDIR/$block | jq -M > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "BLOCK $block READ failed"
exit 1
fi
grep -e 'timestamp' -e 'gpg' -e 'data' -e 'action' -e 'detach' -e 'previous' $AK_BLOCKDIR/$block > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "BLOCK $block is NOT a valid block"
exit 1
@@ -132,19 +132,19 @@ _ak_zblock_show(){
if [ $verify == 1 ]
then
_ak_ipfs_get $gpg > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not get GPG key: $gpg ."
exit 1
fi
_ak_gpg_key_import_from_file $gpg > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not import GPG key: $gpg ."
exit 1
fi
_ak_ipfs_get $block_signature > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Error while getting $block_signature for $block"
exit 1
@@ -153,7 +153,7 @@ _ak_zblock_show(){
_ak_log_info "Block signature downloaded"
_ak_ipfs_get $block > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not get $block block"
exit 1
@@ -161,7 +161,7 @@ _ak_zblock_show(){
_ak_log_info "Downloaded block $block."
_ak_gpg_verify_signature $block.asc $block > /dev/null 2>&1
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not verify $block with GPG key $gpg."
exit 1