Using the same technique as the python path checker to determine the correct md5 command. This improves the previous technique.

This commit is contained in:
Mike Place 2013-10-24 12:10:29 -06:00
parent dce16261eb
commit 167cfd866e

View File

@ -60,14 +60,22 @@ SSH_SHIM = '''/bin/sh << 'EOF'
done
SALT=/tmp/.salt/salt-call
if ( ( [ ! -f {{2}} ] ) && ([ {{2}} == 'md5' ]) )
if [ {{2}} == 'md5' ]
then
SUMCHECK='md5'
for md5_candidate in \\
md5sum \\
md5 ;
do
if [ $(which $md5_candidate 2>/dev/null) ]
then
SUMCHECK=$(which $md5_candidate)
break
fi
done
else
SUMCHECK={{2}}sum
SUMCHECK={{2}}
fi
if [ -f $SALT ]
then
if [ $(cat /tmp/.salt/version) != {0} ]