From 4d2be082126d03e71b1c973c226eebb60b7011d4 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Tue, 1 Dec 2020 21:59:40 -0500 Subject: Update ptmp --- bin/ptmp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin/ptmp') diff --git a/bin/ptmp b/bin/ptmp index e2446c5..e42c695 100755 --- a/bin/ptmp +++ b/bin/ptmp @@ -30,7 +30,15 @@ shift `expr $OPTIND - 1` FILE="$@" -PAD=$(md5sum "${FILE}" | cut -f1 -d' ') +if command -v md5sum >/dev/null; then + MD5=md5sum; +elif command -v md5 >/dev/null; then + MD5="md5 -r"; +else + echo "No md5 found"; +fi + +PAD=$(${MD5} "${FILE}" | cut -f1 -d' ') BASE=$(basename "${FILE}") DEST_NAME="${PAD}.${BASE}${OPT_SUFFIX}" -- cgit v1.2.3