diff --git a/HashProgramOutput.sh b/HashProgramOutput.sh --- a/HashProgramOutput.sh +++ b/HashProgramOutput.sh @@ -9,10 +9,16 @@ is_md5sum=1 if [ ! -x "$md5cmd" ]; then md5cmd=$(which md5) - is_md5sum=0 - if [ ! -x "$md5cmd" ]; then - echo "error: unable to find either 'md5sum' or 'md5'" - exit 1 + if [ -x "$md5cmd" ]; then + is_md5sum=0 + else + md5cmd=$(which csum) + if [ ! -x "$md5cmd" ]; then + echo "error: unable to find either 'md5sum', 'md5' or 'csum'" + exit 1 + fi + # Pass options to make csum behave identically to md5sum. + md5cmd="${md5cmd} -h MD5 -" fi fi