diff options
author | kaotisk <kaotisk@arching-kaos.com> | 2022-01-05 04:35:27 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.com> | 2022-01-05 04:35:27 +0200 |
commit | 117d9cd6208ca13f6dfdbd90ace987d076189cde (patch) | |
tree | e0bbce41dc17bee0181813e42379d26e1c6e9ff1 | |
parent | 94fa2007d44c76b4856ed85a52075b40842697ee (diff) | |
download | arching-kaos-tools-117d9cd6208ca13f6dfdbd90ace987d076189cde.tar.gz arching-kaos-tools-117d9cd6208ca13f6dfdbd90ace987d076189cde.tar.bz2 arching-kaos-tools-117d9cd6208ca13f6dfdbd90ace987d076189cde.zip |
Changes
Minimized the output
Redirected output to null for programs used
-rwxr-xr-x | bin/pack_z_block | 16 |
1 files changed, 8 insertions, 8 deletions
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 |