Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-10-17 18:24:34 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-10-17 18:24:34 +0300
commit7b8c04c3b1e01c3cbf399002318523e5cad6d445 (patch)
tree0b3134d141a71d51a10f5c1bd1f7e030c277eade
parent61fb197638fb70b62f70b2147254caa4171c1a42 (diff)
[BOOT-5202] use generic variables between OSes
-rw-r--r--include/tests_boot_services8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services
index 9167b155..96f3d065 100644
--- a/include/tests_boot_services
+++ b/include/tests_boot_services
@@ -682,11 +682,12 @@
if [ ${SKIPTEST} -eq 0 ]; then
FOUND=0
FIND=""
+ UPTIME_IN_SECS=""
case "${OS}" in
Linux)
# Idle time, not real uptime
if [ -f /proc/uptime ]; then
- FIND=$(cat /proc/uptime | ${CUTBINARY} -d ' ' -f1 | ${CUTBINARY} -d '.' -f1)
+ UPTIME_IN_SECS=$(cat /proc/uptime | ${CUTBINARY} -d ' ' -f1 | ${CUTBINARY} -d '.' -f1)
else
Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW
ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)"
@@ -729,7 +730,7 @@
Solaris)
if [ ! -z "${KSTATBINARY}" ]; then
- FIND=$(${KSTATBINARY} -p unix:0:system_misc:snaptime | ${GREPBINARY} "^unix" | ${AWKBINARY} '{print $2}' | ${CUTBINARY} -d "." -f1)
+ UPTIME_IN_SECS=$(${KSTATBINARY} -p unix:0:system_misc:snaptime | ${GREPBINARY} "^unix" | ${AWKBINARY} '{print $2}' | ${CUTBINARY} -d "." -f1)
else
Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW
ReportException "${TEST_NO}:2" "No uptime test available for this operating system (kstat missing)"
@@ -743,8 +744,7 @@
ReportException "${TEST_NO}:3" "No uptime test available yet for this operating system"
;;
esac
- if [ ! -z "${FIND}" ]; then
- UPTIME_IN_SECS="${FIND}"
+ if [ ! -z "${UPTIME_IN_SECS}" ]; then
UPTIME_IN_DAYS=$((UPTIME_IN_SECS / 60 / 60 / 24))
LogText "Uptime (in seconds): ${UPTIME_IN_SECS}"
LogText "Uptime (in days): ${UPTIME_IN_DAYS}"