From d85efb21fa554877b21f08a3ffdd51ebb49c55ca Mon Sep 17 00:00:00 2001 From: kaotisk Date: Wed, 29 Mar 2023 23:56:26 +0300 Subject: Fix json2bash to ak-json2bash --- bin/ak-enter | 6 +++--- bin/ak-json2bash | 4 ++-- bin/ak-profile | 4 ++-- bin/ak-zchain-chk | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/ak-enter b/bin/ak-enter index 3b2a326..c28e44b 100755 --- a/bin/ak-enter +++ b/bin/ak-enter @@ -101,7 +101,7 @@ do echo -n '{"zblock":"'$zblock'",' # We concatenate the zblock's contents, pipe - # them through filter json2bash and output + # them through filter ak-json2bash and output # them to tmp-file # # We check if any $zblock at all @@ -123,7 +123,7 @@ do logit "[INFO]" "ZBLOCK $zblock is JSON" # Then we pass it through the filter and save it - ipfs --timeout=10s cat $zblock | json2bash > $TEMPASSIN/tmp-zblock + ipfs --timeout=10s cat $zblock | ak-json2bash > $TEMPASSIN/tmp-zblock # Be sure that there are the expected values # We need 'block' and 'block_signature' inside a 'zblock' @@ -159,7 +159,7 @@ do # Same as above applies to BLOCK and DATA subparts of each ZBLOCK # BLOCKS echo -n '"block":"'$block'",' - ipfs --timeout=10s cat $block | json2bash > $TEMPASSIN/tmp-block + ipfs --timeout=10s cat $block | ak-json2bash > $TEMPASSIN/tmp-block if [ "$?" -ne 0 ] then logit "[ERROR]" "BLOCK $block READ failed" diff --git a/bin/ak-json2bash b/bin/ak-json2bash index 347ca93..171a7df 100755 --- a/bin/ak-json2bash +++ b/bin/ak-json2bash @@ -1,11 +1,11 @@ #!/bin/bash # -# json2bash +# ak-json2bash # # Kaotisk Hund # # Strips " , { } from input and replaces ":" with = # # Usage: -# ipfs cat | json2bash +# ipfs cat | ak-json2bash sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/":"/=/g' | sed -e 's/"//g' | sed -e 's/,//g' | sed -e 's/ //g' diff --git a/bin/ak-profile b/bin/ak-profile index 93dd3ca..1aa6e9c 100755 --- a/bin/ak-profile +++ b/bin/ak-profile @@ -131,8 +131,8 @@ index(){ if [ $i != "0" ]; then echo -n ","; fi - PROP=$(echo $(cat $ZPROFILEDIR/$FILE | json2bash) | cut -d '=' -f 1 | awk '{print $0}') - VAL=$(echo $(cat $ZPROFILEDIR/$FILE | json2bash) | cut -d '=' -f 2 | awk '{print $1}') + PROP=$(echo $(cat $ZPROFILEDIR/$FILE | ak-json2bash) | cut -d '=' -f 1 | awk '{print $0}') + VAL=$(echo $(cat $ZPROFILEDIR/$FILE | ak-json2bash) | cut -d '=' -f 2 | awk '{print $1}') echo -n '"'$PROP'":"'$VAL'"'; let i+=1 fi diff --git a/bin/ak-zchain-chk b/bin/ak-zchain-chk index 963754c..3315415 100755 --- a/bin/ak-zchain-chk +++ b/bin/ak-zchain-chk @@ -75,8 +75,8 @@ do ak-logthis "[INFO]" "Created reference" # We concatenate the zblock's contents, pipe them through filter - # json2bash and output them to tmp-file - ipfs cat $zblock | json2bash > $TEMPASSIN/tmp-zblock + # ak-json2bash and output them to tmp-file + ipfs cat $zblock | ak-json2bash > $TEMPASSIN/tmp-zblock ak-logthis "[INFO]" "ZBLOCK $zblock READ" # Supposingly you are on a safe environment and you only have @@ -88,7 +88,7 @@ do # Same as above applies to BLOCK and DATA subparts of each ZBLOCK # BLOCKS - ipfs cat $block | json2bash > $TEMPASSIN/tmp-block + ipfs cat $block | ak-json2bash > $TEMPASSIN/tmp-block source $TEMPASSIN/tmp-block ak-logthis "[INFO]" "BLOCK $block SOURCED" touch $BLOCKDIR/$block -- cgit v1.2.3