Added detection for machine ID

This commit is contained in:
mboelen 2014-09-19 16:43:20 +02:00
parent f5dcb5e7f1
commit d99dbc7406
1 changed files with 11 additions and 0 deletions

View File

@ -476,6 +476,17 @@
report "exception[]=No SHA1/SHA1SUM binary found to create HOSTID"
fi
# Search machine ID
# This applies to IDs generated for systemd
# Optional: DBUS creates ID as well with dbus-uuidgen and is stored in /var/lib/dbus-machine-id (might be symlinked to /etc/machine-id)
sMACHINEIDFILE="/etc/machine-id"
if [ -f ${sMACHINEIDFILE} ]; then
FIND=`head -1 ${sMACHINEIDFILE} | grep "^[a-f0-9]"`
if [ "${FIND}" = "" ]; then
MACHINEID="${FIND}"
fi
fi
}
# Insert section block