mirror of https://github.com/CISOfy/lynis.git
Added Mac OS uptime test [BOOT-5202]
This commit is contained in:
parent
d690369543
commit
ab71616900
|
@ -525,6 +525,15 @@
|
|||
ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)"
|
||||
fi
|
||||
;;
|
||||
MacOS)
|
||||
if [ ! "${SYSCTLBINARY}" = "" ]; then
|
||||
FIND=`${SYSCTLBINARY} kern.boottime | awk '{ print $5 }' | sed -e 's/,//'`
|
||||
else
|
||||
Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW
|
||||
ReportException "${TEST_NO}:3" "No uptime test available for this operating system (sysctl missing)"
|
||||
fi
|
||||
;;
|
||||
|
||||
Solaris)
|
||||
if [ ! "${KSTATBINARY}" = "" ]; then
|
||||
FIND=`${KSTATBINARY} -p unix:0:system_misc:snaptime | grep "^unix" | awk '{print $2}' | cut -d "." -f1`
|
||||
|
@ -545,13 +554,12 @@
|
|||
UPTIME_IN_DAYS=`expr ${UPTIME_IN_SECS} / 60 / 60 / 24`
|
||||
logtext "Uptime (in seconds): ${UPTIME_IN_SECS}"
|
||||
logtext "Uptime (in days): ${UPTIME_IN_DAYS}"
|
||||
report "uptime_in_seconds=${UPTIME_IN_SECS}"
|
||||
report "uptime_in_days=${UPTIME_IN_DAYS}"
|
||||
else
|
||||
logtext "Result: no uptime information available"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue