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