From 98f0d3cd7cc972bec86f8806406b6f11440e66e1 Mon Sep 17 00:00:00 2001 From: Franscobec Date: Mon, 19 Jan 2026 20:08:01 -0500 Subject: [PATCH] Update computechecksums.sh --- computechecksums.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/computechecksums.sh b/computechecksums.sh index ef5df6b..b0eae9e 100644 --- a/computechecksums.sh +++ b/computechecksums.sh @@ -1,8 +1,17 @@ #!/bin/bash FILE="$1" +if [ -f "./checksums.txt" ]; then +truncate ./checksums.txt +else touch ./checksums.txt -sha1sum "$FILE" >> ./checksums.txt -md5sum "$FILE" >> ./checksums.txt -sha256sum "$FILE" >> ./checksums.txt +fi +echo $FILE >> ./checksums.txt +echo '' >> ./checksums.txt + +echo 'SHA1' >> ./checksums.txt && sha1sum "$FILE" | awk '{print $1}' >> ./checksums.txt +echo '' >> ./checksums.txt +echo 'MD5' >> ./checksums.txt && md5sum "$FILE" | awk '{print $1}' >> ./checksums.txt +echo '' >> ./checksums.txt +echo 'SHA256' >> ./checksums.txt && sha256sum "$FILE" | awk '{print $1}' >> ./checksums.txt