aboutsummaryrefslogtreecommitdiff
path: root/lib
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
parent35ddac1871fbbc608417e1b1ec2012bf09687edd (diff)
downloadarching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.gz
arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.bz2
arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.zip
Refactoring
Diffstat (limited to 'lib')
-rwxr-xr-xlib/_ak_fs2
-rwxr-xr-xlib/_ak_ipfs2
-rwxr-xr-xlib/_ak_network2
-rwxr-xr-xlib/_ak_zblock16
-rwxr-xr-xlib/_ak_zchain4
5 files changed, 13 insertions, 13 deletions
diff --git a/lib/_ak_fs b/lib/_ak_fs
index da09f93..ac466b4 100755
--- a/lib/_ak_fs
+++ b/lib/_ak_fs
@@ -282,7 +282,7 @@ _ak_fs_find_depth(){
exit 111
# Try to download stuff
# wget -s $remoteMrk/$currentNode -O $fmrk/$currentNode
- # if [ "$?" -ne 0 ]
+ # if [ $? -ne 0 ]
# then
# exit 111
# fi
diff --git a/lib/_ak_ipfs b/lib/_ak_ipfs
index f7c2dac..3437083 100755
--- a/lib/_ak_ipfs
+++ b/lib/_ak_ipfs
@@ -407,7 +407,7 @@ _ak_ipfs_cid_v0_check () {
exit 1
fi
echo $1 | grep -e 'Qm.\{44\}' > /dev/null
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "$1 is not an IPFS CIDv0 string"
exit 1
diff --git a/lib/_ak_network b/lib/_ak_network
index aa8105e5..1d77eef 100755
--- a/lib/_ak_network
+++ b/lib/_ak_network
@@ -100,7 +100,7 @@ _ak_network_scan_stellar(){
test="$(curl \
--connect-timeout 3 \
https://horizon.stellar.org/accounts/$p/data/config 2>/dev/null | grep value)"
- if [ "$?" == 0 ]
+ if [ $? -eq 0 ]
then
addressValuePair="$(printf '%s %s\n' "$p" "$(echo $test | sed -e 's/^.*: "//g; s/"//g' | base64 -d)")"
while IFS="" read -r x || [ -n "$x" ]
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
diff --git a/lib/_ak_zchain b/lib/_ak_zchain
index d6925bf..d15048a 100755
--- a/lib/_ak_zchain
+++ b/lib/_ak_zchain
@@ -29,7 +29,7 @@ _ak_zchain_reset(){
if [ $? != 0 ]; then exit 1; fi
ak-config --publish
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not publish new configuration"
exit 1
@@ -68,7 +68,7 @@ _ak_zchain_rebase(){
if [ $? != 0 ]; then exit 1; fi
ak-config --publish
- if [ "$?" -ne 0 ]
+ if [ $? -ne 0 ]
then
_ak_log_error "Could not publish new configuration"
exit 1