...
 
Commits (2)
This diff is collapsed.
#!/usr/bin/env dash
# Copyright (c) 2014, Thomas Fischer <[email protected]>
# Copyright (c) 2014-2017, Thomas Fischer <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
......@@ -26,7 +26,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MY_NAME="$(basename -- "$0")"
VERSIONNUMBER="20150424"
VERSIONNUMBER="20170617"
SHOW_HELP=0
SHOW_VERSION=0
SHOW_LICENSE=0
......@@ -66,7 +66,7 @@ while true ; do
done
if [ ${SHOW_HELP} -ne 0 ] ; then
echo "Create hash sums (SHA1, SHA512, MD5) for a given file and GnuPG-sign each" >&2
echo "Create hash sums (SHA1, SHA512, SHA256, MD5) for a given file and GnuPG-sign each" >&2
echo >&2
echo "Copyright (c) 2014, Thomas Fischer <[email protected]>" >&2
echo "All rights reserved." >&2
......@@ -117,7 +117,7 @@ for FILE_NAME in "[email protected]" ; do
FILE_BASENAME="$(basename -- "${FILE_NAME}")"
# Apply a number of cryptographic hash programs
for HASH_PROG in sha512sum sha1sum md5sum ; do
for HASH_PROG in sha512sum sha256sum sha1sum md5sum ; do
# Suffixes for hashs should match hash programs' names without 'sum'
SUFFIX=$(echo ${HASH_PROG} | sed -e 's/sum$//g')
# If the hash program is available, apply it to input file, write hash into .asc file
......@@ -132,7 +132,7 @@ for FILE_NAME in "[email protected]" ; do
# Invoke gpg to verify a detached signature on the input file
gpg --verify "${FILE_BASENAME}.asc" || { echo "Could not verify detached signature '${FILE_BASENAME}.asc' in '${PWD}'" >&2 ; exit 1 ; }
for SUFFIX in sha512 sha1 md5 ; do
for SUFFIX in sha512 sha256 sha1 md5 ; do
# Skip to next suffix if no hash file has create for this suffix
test -s "${FILE_BASENAME}.${SUFFIX}" || continue
......