diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-31 12:00:59 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-31 12:00:59 +0300 |
commit | e4f18be94261b39544ef3bc50321f6aedeb45bd6 (patch) | |
tree | 2c79daf0bdc91beb91846f00bb3d3f51236967cf /bin/ak-zblock-cache | |
parent | 23a61661f03c03a357ad8aa47ba3595fabe24de1 (diff) | |
download | arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.gz arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.bz2 arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.zip |
huge refactor, might breaking things
Diffstat (limited to 'bin/ak-zblock-cache')
-rwxr-xr-x | bin/ak-zblock-cache | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/bin/ak-zblock-cache b/bin/ak-zblock-cache deleted file mode 100755 index c314d56..0000000 --- a/bin/ak-zblock-cache +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -source $AK_LIBDIR/_ak_logit - -if [ ! -d "$AK_CACHEDIR/fzblocks" ] -then - mkdir $AK_CACHEDIR/fzblocks -fi - -if [ ! -z "$1" ] -then - if [ -f "$AK_ZBLOCKDIR/$1" ] && [ "$(du -b $AK_ZBLOCKDIR | awk '{ print $1 }')" != "0" ] - then - if [ "$(sha512sum $AK_ZBLOCKDIR/$1 | awk '{ print $1 }')" == "$(ak-zblock-show $1 | sha512sum | awk '{ print $1 }')" ] - then - logit "INFO" "Cache already there and updated" - else - logit "INFO" "Updating cache" - ak-zblock-show "$1" > $AK_CACHEDIR/fzblocks/$1 - fi - logit "INFO" "No cache found. Caching..." - ak-zblock-show "$1" - if [ "$?" -ne "0" ] - then - logit "ERROR" "ak-zblock-show failed..." - exit 2 - fi - ak-zblock-show "$1" > $AK_CACHEDIR/fzblocks/$1 - else - ak-zblock-show "$1" > $AK_CACHEDIR/fzblocks/$1 - if [ "$?" -ne "0" ] - then - logit "ERROR" "ak-zblock-show failed..." - exit 2 - fi - logit "ERROR" "Could not find zblock $1..." - exit 1 - fi - exit 0 -else - printf "Usage:\n\t%s <zblock-ipfs-hash>\n" "$PROGRAM" 1>&2 - exit 1 -fi - |