summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-15 09:37:29 +0200
committerErich Eckner <git@eckner.net>2017-08-15 09:37:29 +0200
commit989d590e79e47e38d7f2d5d53fed0cb132d6bc99 (patch)
tree7b5ad355ebc6eb94c9d470adba74551808024d18
parentca0c5b8a50fbf34200912c2635bb8c4b12a820d2 (diff)
downloadbuff-di-wuff-989d590e79e47e38d7f2d5d53fed0cb132d6bc99.tar.xz
auch sha256-Summe speichern
-rwxr-xr-xbuff-di-wuff13
1 files 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