2010-03-08 00:26:58 +00:00
|
|
|
# try to find an md5 program
|
|
|
|
|
2012-10-14 14:49:25 +00:00
|
|
|
if [ X"$(echo | md5sum -b 2> /dev/null)" != X ]; then
|
2010-03-08 00:26:58 +00:00
|
|
|
do_md5sum() { md5sum -b $1; }
|
2012-05-30 02:31:16 +00:00
|
|
|
elif [ X"$(echo | command md5 2> /dev/null)" != X ]; then
|
|
|
|
do_md5sum() { command md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
|
2010-03-08 00:26:58 +00:00
|
|
|
elif [ -x /sbin/md5 ]; then
|
2012-06-01 01:52:22 +00:00
|
|
|
do_md5sum() { /sbin/md5 -r $1 | sed 's/\([0-9a-f]\) [ *]*/\1 */'; }
|
2010-10-07 12:54:10 +00:00
|
|
|
elif openssl version >/dev/null 2>&1; then
|
|
|
|
do_md5sum() { openssl md5 $1 | sed 's/MD5(\(.*\))= \(.*\)/\2 *\1/'; }
|
2010-03-08 00:26:58 +00:00
|
|
|
else
|
|
|
|
do_md5sum() { echo No md5sum program found; }
|
|
|
|
fi
|