diff options
Diffstat (limited to 'include/functions')
-rw-r--r-- | include/functions | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/functions b/include/functions index 01e62e42..c266ca10 100644 --- a/include/functions +++ b/include/functions @@ -804,11 +804,17 @@ # Name : GetHostID() # Description : Create an unique id for the system # - # Returns : Nothing + # Returns : optional value # Usage : GetHostID ################################################################################ GetHostID() { + + if [ ! -z "${HOSTID}" -a ! -z "${HOSTID2}" ]; then + Debug "Skipping creation of host identifiers, as they are already configured (via profile)" + return 1 + fi + FIND="" # Avoid some hashes (empty, only zeros) BLACKLISTED_HASHES="6ef1338f520d075957424741d7ed35ab5966ae97 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc" @@ -1104,6 +1110,8 @@ # Show an exception if no HostID could be created, to ensure each system (and scan) has one if [ "${HOSTID}" = "" ]; then ReportException "GetHostID" "No unique host identifier could be created." + elif [ ! -z "${HOSTID2}" ]; then + return 0 fi } |