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