From e4f18be94261b39544ef3bc50321f6aedeb45bd6 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 31 Mar 2024 12:00:59 +0300 Subject: huge refactor, might breaking things --- bin/ak-zblock-cache | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 bin/ak-zblock-cache (limited to 'bin/ak-zblock-cache') 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 \n" "$PROGRAM" 1>&2 - exit 1 -fi - -- cgit v1.2.3