From 1a832476bb14450a85f3e630296c9981802306e5 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 5 Sep 2016 19:48:23 +0200 Subject: [PATCH] [TIME-3104] Changed timedatectl test --- include/tests_time | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/tests_time b/include/tests_time index 0599c19e..28a1b68c 100644 --- a/include/tests_time +++ b/include/tests_time @@ -70,7 +70,7 @@ fi # Check running processes - FIND=`${PSBINARY} ax | ${GREPBINARY} "ntpd" | ${GREPBINARY} -v "dntpd" | ${GREPBINARY} -v "grep"` + FIND=$(${PSBINARY} ax | ${GREPBINARY} "ntpd" | ${GREPBINARY} -v "dntpd" | ${GREPBINARY} -v "grep") if [ ! "${FIND}" = "" ]; then FOUND=1; NTPD_RUNNING=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1 NTP_DAEMON="ntpd" @@ -86,8 +86,8 @@ fi # Check timedate daemon (systemd) - if [ ! "${TIMEDATECTL}" = "" ]; then - FIND=`${TIMEDATECTL} status | ${GREPBINARY} "NTP enabled: yes"` + if [ ! -z "${TIMEDATECTL}" ]; then + FIND=$(${TIMEDATECTL} status | ${GREPBINARY} "NTP synchronized: yes") if [ ! "${FIND}" = "" ]; then # Check for systemd-timesyncd if [ -f /etc/systemd/timesyncd.conf ]; then @@ -95,7 +95,7 @@ Display --indent 2 --text "- NTP daemon found: systemd (timesyncd)" --result "${STATUS_FOUND}" --color GREEN SYSTEMD_NTP_ENABLED=1 fi - else + else LogText "Result: time sychronization not performed according timedatectl command" fi fi