Use the data from machine ID when no SSH keys are available

This commit is contained in:
Michael Boelen 2017-01-28 12:11:38 +01:00
parent 78c9761c60
commit ed45fe7b29
1 changed files with 4 additions and 4 deletions

View File

@ -1029,15 +1029,15 @@
if [ ! -z "${STRING_TO_HASH}" ]; then
# Create hashes
if [ ! "${SHA256SUMBINARY}" = "" ]; then
HASH_SSH=$(echo ${DATA_SSH} | ${SHA256SUMBINARY} | awk '{ print $1 }')
HASH2=$(echo ${STRING_TO_HASH} | ${SHA256SUMBINARY} | awk '{ print $1 }')
HASH_HOSTNAME=$(echo ${HOSTNAME} | ${SHA256SUMBINARY} | awk '{ print $1 }')
elif [ ! "${OPENSSLBINARY}" = "" ]; then
HASH_SSH=$(echo ${DATA_SSH} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
HASH2=$(echo ${STRING_TO_HASH} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
HASH_HOSTNAME=$(echo ${HOSTNAME} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
fi
LogText "Hash (hostname): ${HASH_HOSTNAME}"
LogText "Hash (ssh): ${HASH_SSH}"
HOSTID2="${HASH_SSH}"
LogText "Hash (ssh or machineid): ${HASH2}"
HOSTID2="${HASH2}"
Report "hostid2=${HOSTID2}"
fi
fi