aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-03-29 23:56:26 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-03-29 23:56:26 +0300
commitd85efb21fa554877b21f08a3ffdd51ebb49c55ca (patch)
tree1480b679bc1c29ecb396eb9396979ce8fcee2880 /bin
parent1c25589a8aca3d6dbb84a37240efd4652fbfeab7 (diff)
downloadarching-kaos-tools-d85efb21fa554877b21f08a3ffdd51ebb49c55ca.tar.gz
arching-kaos-tools-d85efb21fa554877b21f08a3ffdd51ebb49c55ca.tar.bz2
arching-kaos-tools-d85efb21fa554877b21f08a3ffdd51ebb49c55ca.zip
Fix json2bash to ak-json2bash
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ak-enter6
-rwxr-xr-xbin/ak-json2bash4
-rwxr-xr-xbin/ak-profile4
-rwxr-xr-xbin/ak-zchain-chk6
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 <kaotisk/kaotiskhund>
#
# Strips " , { } from input and replaces ":" with =
#
# Usage:
-# ipfs cat <hash> | json2bash
+# ipfs cat <hash> | 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