aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-12-18 08:01:13 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-12-18 08:01:13 +0200
commit7b4deed0b8fe309631f35dfc9ed9b6c09d09f325 (patch)
tree5d94c97a94f05b524e285b2638e9e1554d130903
parentaf5e46aa4c258a115ac2e5894a69aa8a019c3009 (diff)
downloadarching-kaos-tools-7b4deed0b8fe309631f35dfc9ed9b6c09d09f325.tar.gz
arching-kaos-tools-7b4deed0b8fe309631f35dfc9ed9b6c09d09f325.tar.bz2
arching-kaos-tools-7b4deed0b8fe309631f35dfc9ed9b6c09d09f325.zip
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
-rwxr-xr-xpack_z_block18
1 files 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 <<EOF
@@ -79,8 +79,8 @@ EOF
}
title(){
- echo "AK zblock creator from ACTION and FILE"
- echo "======================================"
+ echo "AK zblock creator"
+ echo "================="
}
title
@@ -93,19 +93,21 @@ then
main
else
echo "File does not exist. Aborting..."
- usage
+ exit 1
fi
# cat $PWD/zblock | json_pp
# Optional or extending with
# 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)-$(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