diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-01 19:26:24 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-01 19:26:24 +0200 |
commit | f8d2236e55e5c369b218017d1de1058d6a8ee361 (patch) | |
tree | 1cdd4ea1476c3062d3dd38ee1ba62d6bb98eb680 /bin/ak-zblock-pack | |
parent | 7affa2082f61455a413d0c8fea08e79935d4f308 (diff) | |
download | arching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.tar.gz arching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.tar.bz2 arching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.zip |
Log formatting adjustment
Diffstat (limited to 'bin/ak-zblock-pack')
-rwxr-xr-x | bin/ak-zblock-pack | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/ak-zblock-pack b/bin/ak-zblock-pack index 5d84976..25377bc 100755 --- a/bin/ak-zblock-pack +++ b/bin/ak-zblock-pack @@ -19,7 +19,7 @@ set -xe # Logging patch logit(){ - ak-logthis "<$PROGRAM>" "$1" "$2" + ak-logthis "$PROGRAM" "$1" "$2" } # Below, the usage information @@ -48,13 +48,13 @@ main(){ do if [ "$p" == "$TO_CHECK" ] then - logit "[ERROR]" "Value $TO_CHECK already mentioned on the zchain" + logit "ERROR" "Value $TO_CHECK already mentioned on the zchain" exit 1 fi done < tempisalreadythere rm tempisalreadythere - - logit "[INFO]" "We are doing $ACTION with content $MESSAGE" + + logit "INFO" "We are doing $ACTION with content $MESSAGE" # We add it to IPFS MESSAGE_HASH=$(ak-ipfs-add $MESSAGE) @@ -101,7 +101,7 @@ then if [ -f "$MESSAGE" ]; then main else - logit "[ERROR]" "File does not exist. Aborting..." + logit "ERROR" "File does not exist. Aborting..." exit 1 fi @@ -113,42 +113,42 @@ then ak-ipfs-name-publish --key=zchain $ZBLOCK > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[ERROR]" "Failed publishing ZBLOCK: $ZBLOCK" + logit "ERROR" "Failed publishing ZBLOCK: $ZBLOCK" exit 1 fi ak-ipfs-files-ls /zarchive > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[WARNING]" "/zarchive does not exist" + logit "WARNING" "/zarchive does not exist" ak-ipfs-files-mkdir /zarchive > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[ERROR]" "Could not create /zarchive directory. Aborting." + logit "ERROR" "Could not create /zarchive directory. Aborting." exit 1 fi fi ak-ipfs-files-cp /zlatest /zarchive/$(date -u +%s)-$(ak-ipfs-files-stat /zlatest | head -n 1) > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[ERROR]" "Could not back up previous /zlatest" + logit "ERROR" "Could not back up previous /zlatest" exit 1 fi ak-ipfs-files-rm /zlatest > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[ERROR]" "Could not remove previous /zlatest" + logit "ERROR" "Could not remove previous /zlatest" exit 1 fi ak-ipfs-files-cp /ipfs/$ZBLOCK /zlatest > /dev/null 2>&1 if [ "$?" -ne 0 ] then - logit "[ERROR]" "Could not copy $ZBLOCK to /zlatest" + logit "ERROR" "Could not copy $ZBLOCK to /zlatest" exit 1 fi ak-config publish if [ "$?" -ne 0 ] then - logit "[ERROR]" "Could not publish new configuration" + logit "ERROR" "Could not publish new configuration" exit 1 fi else |