Modify lsmeme to fit our purpose. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 7f7cfb2f35485b7e592eca9429dd580f956e277f DIR parent f0b0455d616e10227c2b915bae527c915cdc54dc HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Tue, 19 May 2020 19:12:29 +0200 Modify lsmeme to fit our purpose. Diffstat: M lsmemes | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- DIR diff --git a/lsmemes b/lsmemes @@ -1,14 +1,15 @@ #!/bin/sh MEMEFILE=/home/annna/bin/modules/hashtags/hashtags.txt -MEMEDIR=/br/gopher +MEMEDIR=/br/gopher/memecache printf "meme2\n" -while read -r tag meme; do - - hash=$(sha512sum ${MEMEDIR}/$(echo $meme | cut -d "/" -f 5-) | awk '{print $1}') +while read -r tag meme; +do + memeuri="$(printf "%s\n" "${meme}" | cut -d' ' -f 2)" + memefile="$(basename "${memeuri}")" + hash="$(sha512sum ${MEMEDIR}/${memefile} | cut -d' ' -f 1)" printf "%s %s %s\n" $tag $meme $hash - done < $MEMEFILE