mirror of https://github.com/CISOfy/lynis.git
Fix detecting systemd timedate deamon (#494)
Fix detecting systemd timedate daemon
This commit is contained in:
parent
0519b82cba
commit
21b129f947
|
@ -99,7 +99,7 @@
|
||||||
|
|
||||||
# Check timedate daemon (systemd)
|
# Check timedate daemon (systemd)
|
||||||
if [ ! -z "${TIMEDATECTL}" ]; then
|
if [ ! -z "${TIMEDATECTL}" ]; then
|
||||||
FIND=$(${TIMEDATECTL} status | ${GREPBINARY} "NTP synchronized: yes")
|
FIND=$(${TIMEDATECTL} status | ${EGREPBINARY} "(NTP|System clock) synchronized: yes")
|
||||||
if [ ! -z "${FIND}" ]; then
|
if [ ! -z "${FIND}" ]; then
|
||||||
# Check for systemd-timesyncd
|
# Check for systemd-timesyncd
|
||||||
if [ -f /etc/systemd/timesyncd.conf ]; then
|
if [ -f /etc/systemd/timesyncd.conf ]; then
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
Register --test-no TIME-3106 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check systemd NTP time synchronization status"
|
Register --test-no TIME-3106 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check systemd NTP time synchronization status"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
LogText "Test: Check the status of time synchronization via timedatectl"
|
LogText "Test: Check the status of time synchronization via timedatectl"
|
||||||
FIND=$(${TIMEDATECTL} status | ${GREPBINARY} "NTP synchronized: yes")
|
FIND=$(${TIMEDATECTL} status | ${EGREPBINARY} "(NTP|System clock) synchronized: yes")
|
||||||
if [ -z "${FIND}" ]; then
|
if [ -z "${FIND}" ]; then
|
||||||
LogText "Result: time not synchronized via NTP"
|
LogText "Result: time not synchronized via NTP"
|
||||||
ReportSuggestion "${TEST_NO}" "Check timedatectl output. Sychronization via NTP is enabled, but status reflects it is not synchronized"
|
ReportSuggestion "${TEST_NO}" "Check timedatectl output. Sychronization via NTP is enabled, but status reflects it is not synchronized"
|
||||||
|
|
Loading…
Reference in New Issue