From 8adacb20369410f1fa70e14d640d6d681b10851e Mon Sep 17 00:00:00 2001 From: kaotisk Date: Mon, 17 Jan 2022 20:53:06 +0200 Subject: Making the output to be JSON, log messages to log file --- bin/profile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'bin/profile') diff --git a/bin/profile b/bin/profile index 905ceba..6b0cde6 100755 --- a/bin/profile +++ b/bin/profile @@ -32,8 +32,10 @@ tempassin(){ show(){ if [ ! -z $1 ] then - echo "Working with $1" - ipfs cat $1 + logthis "Working with $1" + echo '"data":"'$1'",' + echo '"'$1'":'$(ipfs cat $1)',' + #ipfs cat $1 else echo "No DATA provided" exit 1 @@ -125,15 +127,19 @@ propset(){ index(){ FILES="$(ls -1 $ZPROFILEDIR)" i=0 + echo "{" for FILE in $FILES do - + if [ $i != "0" ]; then + echo ","; + 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}') - echo $i \| $PROP \| $VAL + echo '"'$PROP'":"'$VAL'"' let i+=1 - done + done + echo "}" } title(){ echo "ak-profile-cli" -- cgit v1.2.3