18 lines
495 B
Bash
18 lines
495 B
Bash
#!/bin/bash
|
|
FILE="$1"
|
|
|
|
if [ -f "./checksums.txt" ]; then
|
|
truncate -s0 ./checksums.txt
|
|
else
|
|
touch ./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
|