From 117d9cd6208ca13f6dfdbd90ace987d076189cde Mon Sep 17 00:00:00 2001 From: kaotisk Date: Wed, 5 Jan 2022 04:35:27 +0200 Subject: Changes Minimized the output Redirected output to null for programs used --- bin/pack_z_block | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'bin/pack_z_block') diff --git a/bin/pack_z_block b/bin/pack_z_block index 0e617c3..bf0dd76 100755 --- a/bin/pack_z_block +++ b/bin/pack_z_block @@ -16,6 +16,7 @@ # Below, the usage information usage(){ + title echo "$0 - action data_file" echo "Creates and publishes a ZBLOCK based on ACTION and DATA file." echo "" @@ -26,7 +27,7 @@ usage(){ main(){ - echo "We are doing" $ACTION "with content" $MESSAGE + logthis "We are doing" $ACTION "with content" $MESSAGE # We add it to IPFS MESSAGE_HASH=$(ipfs add -q $MESSAGE) @@ -84,7 +85,6 @@ title(){ echo "=================" } -title if [ ! -z $2 ]; then PWD="$(pwd)" @@ -93,7 +93,7 @@ then if [ -f "$MESSAGE" ]; then main else - echo "File does not exist. Aborting..." + logthis "File does not exist. Aborting..." exit 1 fi @@ -102,11 +102,11 @@ then # python send_as_ak_tx $ZBLOCK # or for "offline" use echo $ZBLOCK > $ZLATEST - ipfs name publish --key=zchain $ZBLOCK - ipfs files mkdir /zarchive - ipfs files cp /zlatest /zarchive/$(date -u +%s)-$(ipfs files stat /zlatest | head -n 1) - ipfs files rm /zlatest - ipfs files cp /ipfs/$ZBLOCK /zlatest + ipfs name publish --key=zchain $ZBLOCK > /dev/null 2>&1 + ipfs files mkdir /zarchive > /dev/null 2>&1 + ipfs files cp /zlatest /zarchive/$(date -u +%s)-$(ipfs files stat /zlatest | head -n 1) > /dev/null 2>&1 + ipfs files rm /zlatest > /dev/null 2>&1 + ipfs files cp /ipfs/$ZBLOCK /zlatest > /dev/null 2>&1 else usage exit 0 -- cgit v1.2.3