From 7b4deed0b8fe309631f35dfc9ed9b6c09d09f325 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 18 Dec 2021 08:01:13 +0200 Subject: Changes - FINGERPRINT assign is removed since is now part of config and environment - IPFS files system lowercase policy :) - Shorten title of script - Mess with exit codes - Pushes ZBLOCK's CID into ZLATEST file --- pack_z_block | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pack_z_block b/pack_z_block index a323ddf..da5e22b 100755 --- a/pack_z_block +++ b/pack_z_block @@ -12,7 +12,7 @@ #FINGERPRINT="CHANGE THIS TO YOUR DEFAULT FINGERPRINT" # We acquire the GPG fingerprint by email address # The following example finds kaos@kaos.kaos' GPG fingerprint like this -FINGERPRINT="$(gpg2 --list-keys | grep kaos@kaos.kaos -1 | head -n1 | awk '{print $1}')" +# FINGERPRINT="$(gpg2 --list-keys | grep kaos@kaos.kaos -1 | head -n1 | awk '{print $1}')" # Below, the usage information usage(){ @@ -42,7 +42,7 @@ main(){ GPG_PUB_KEY=$(ipfs add -q $KEY) # Acquire last block of information, to chain this one with previous posted - PREVIOUS=$(ipfs files stat /ZLATEST | head -n 1) + PREVIOUS=$(ipfs files stat /zlatest | head -n 1) # We create a block of json like this: cat > block < $ZLATEST ipfs name publish --key=zchain $ZBLOCK ipfs files mkdir /zarchive - ipfs files cp /ZLATEST /zarchive/$(date -u +%s)-$(head -n 1 $(ipfs files stat /ZLATEST)) - ipfs files rm /ZLATEST - ipfs files cp /ipfs/$ZBLOCK /ZLATEST + 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 else usage + exit 0 fi -- cgit v1.2.3