mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
use correct regex and comparison to match peers
This commit is contained in:
parent
df7c6257a5
commit
9107867fa1
@ -576,8 +576,8 @@
|
||||
Register --test-no TIME-3182 --preqs-met "${PREQS_MET}" --weight L --network NO --category security --description "Check OpenNTPD has working peers"
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
# Format is "xx/yy peers valid, ..."
|
||||
FIND=$(${NTPCTLBINARY} -s status | ${EGREPBINARY} -o "[0-9]{1,4}/" | ${EGREPBINARY} -o "[0-9]{1,4}" )
|
||||
if [ -n "${FIND}" ] || [ "${FIND}" -eq 0 ]; then
|
||||
FIND=$(${NTPCTLBINARY} -s status | ${EGREPBINARY} -o '[0-9]+/[0-9]+' | ${CUTBINARY} -d '/' -f 1)
|
||||
if [ -z "${FIND}" ] || [ "${FIND}" -eq 0 ]; then
|
||||
ReportWarning "${TEST_NO}" "OpenNTPD has no peers" "${NTPCTLBINARY} -s status"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user