summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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