mirror of https://github.com/CISOfy/lynis.git
Changed some report calls to ReportException
This commit is contained in:
parent
4a7d10d8d6
commit
0228bd5317
|
@ -290,14 +290,14 @@
|
|||
else
|
||||
FIND=`${IFCONFIGBINARY} 2> /dev/null | grep "ether " | awk '{ print $2 }' | head -1 | tr '[:upper:]' '[:lower:]'`
|
||||
if [ "${FIND}" = "" ]; then
|
||||
report "exception[]=No eth0 found (and no ether was found with ifconfig)"
|
||||
ReportException "GetHostID" "No eth0 found (and no ether was found with ifconfig)"
|
||||
else
|
||||
logtext "Result: No eth0 found (ether found), using first network interface to determine hostid (with ifconfig)"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
FIND=`${IFCONFIGBINARY} 2> /dev/null | grep HWaddr | head -1 | awk '{ print $5 }' | tr '[:upper:]' '[:lower:]'`
|
||||
report "exception[]=No eth0 found (but HWaddr was found), using first network interface to determine hostid, with ifconfig"
|
||||
ReportException "GetHostID" "No eth0 found (but HWaddr was found), using first network interface to determine hostid, with ifconfig"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -311,7 +311,7 @@
|
|||
# Determine the MAC address of first interface with the ip command
|
||||
FIND=`${IPBINARY} addr show 2> /dev/null | egrep "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]'`
|
||||
if [ "${FIND}" = "" ]; then
|
||||
report "exception[]=Can't create hostid (no MAC addresses found)"
|
||||
ReportException "GetHostID" "Can't create hostid (no MAC addresses found)"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -321,7 +321,7 @@
|
|||
logtext "Result: Found HostID: ${HOSTID}"
|
||||
fi
|
||||
else
|
||||
report "exception[]=Can't create HOSTID, command ip not found"
|
||||
ReportException "GetHostID" "Can't create HOSTID, command ip not found"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in New Issue