From 989d590e79e47e38d7f2d5d53fed0cb132d6bc99 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 15 Aug 2017 09:37:29 +0200 Subject: auch sha256-Summe speichern --- buff-di-wuff | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/buff-di-wuff b/buff-di-wuff index d14a239..eea49d7 100755 --- a/buff-di-wuff +++ b/buff-di-wuff @@ -11,13 +11,20 @@ grep '^[^#]' '/etc/buff-di-wuff.list' | \ if ! wget -O "${cache_dir}/tmp" "${url}" 2> /dev/null; then continue fi - sum="$( + sum512="$( sha512sum "${cache_dir}/tmp" | \ cut -d' ' -f1 )" - if [ ! -f "${cache_dir}/${sum}" ]; then - mv "${cache_dir}/tmp" "${cache_dir}/${sum}" + sum256="$( + sha256sum "${cache_dir}/tmp" | \ + cut -d' ' -f1 + )" + if [ ! -f "${cache_dir}/${sum512}" ]; then + mv "${cache_dir}/tmp" "${cache_dir}/${sum512}" else rm "${cache_dir}/tmp" fi + if [ ! -f "${cache_dir}/${sum256}" ]; then + ln "${cache_dir}/${sum512}" "${cache_dir}/${sum256}" + fi done -- cgit v1.2.3-70-g09d2