mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-29 16:54:26 +02:00
use STATBINARY, put filename in variable
This commit is contained in:
parent
38b6105c60
commit
e27208a342
@ -585,11 +585,12 @@
|
|||||||
|
|
||||||
|
|
||||||
Register --test-no TIME-3185 --preqs-met "${PREQS_MET}" --weight L --network NO --category "security" --description "Check systemd-timesyncd synchronized time"
|
Register --test-no TIME-3185 --preqs-met "${PREQS_MET}" --weight L --network NO --category "security" --description "Check systemd-timesyncd synchronized time"
|
||||||
|
SYNCHRONIZED_FILE="/run/systemd/timesync/synchronized"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
if [ -e /run/systemd/timesync/synchronized ]; then
|
if [ -e "${SYNCHRONIZED_FILE}" ]; then
|
||||||
FIND=$(( $(date +%s) - $(stat -L --format %Y /run/systemd/timesync/synchronized) ))
|
FIND=$(( $(date +%s) - $(${STATBINARY} -L --format %Y "${SYNCHRONIZED_FILE}") ))
|
||||||
# Check if last sync was more than 2048 seconds (= the default of systemd) ago
|
# Check if last sync was more than 2048 seconds (= the default of systemd) ago
|
||||||
if [ ${FIND} -ge 2048 ]; then
|
if [ "${FIND}" -ge 2048 ]; then
|
||||||
COLOR=RED
|
COLOR=RED
|
||||||
ReportWarning "${TEST_NO}" "systemd-timesyncd did not synchronized the time recently."
|
ReportWarning "${TEST_NO}" "systemd-timesyncd did not synchronized the time recently."
|
||||||
else
|
else
|
||||||
@ -602,7 +603,7 @@
|
|||||||
ReportWarning "${TEST_NO}" "systemd-timesyncd never successfully synchronized time"
|
ReportWarning "${TEST_NO}" "systemd-timesyncd never successfully synchronized time"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
unset SYNCHRONIZED_FILE
|
||||||
|
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user