gluon/scripts/md5sum.sh
2014-05-15 22:59:12 +02:00

19 lines
297 B
Bash
Executable File

#!/bin/sh
check_command() {
which $1 >/dev/null 2>&1
}
if check_command md5sum; then
ret="$(md5sum "$@")"
elif check_command md5; then
ret="$(md5 -q "$@")"
else
echo "$0: no suitable md5sum implementation was found" >&1
exit 1
fi
[ "$?" -eq 0 ] || exit 1
echo "$ret" | awk '{ print $1 }'