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