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:
authorSimon Biewald <simon@fam-biewald.de>2020-07-09 19:57:01 +0300
committerSimon Biewald <simon@fam-biewald.de>2020-07-09 19:57:01 +0300
commit9107867fa1307a7ec65f250efbc2440665078fb0 (patch)
tree0af67a7faf8673f56a9b4c5135d13360d11f174b /include/tests_time
parentdf7c6257a56d54a001859c209b92f7e74589cd13 (diff)
use correct regex and comparison to match peers
Diffstat (limited to 'include/tests_time')
-rw-r--r--include/tests_time4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/tests_time b/include/tests_time
index 79e7aa2e..eee5cbfc 100644
--- a/include/tests_time
+++ b/include/tests_time
@@ -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