Cleanup of test and properly show status of timedated [TIME-3104]

This commit is contained in:
mboelen 2014-10-13 19:19:40 +02:00
parent 7c067c62c4
commit 0378677ea9
1 changed files with 6 additions and 16 deletions

View File

@ -56,38 +56,29 @@
FOUND=1; NTPD_RUNNING=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1
NTP_DAEMON="ntpd"
logtext "Result: found running NTP daemon in process list"
Display --indent 2 --text "- Checking running NTP daemon (ntpd)" --result FOUND --color GREEN
else
logtext "Result: NTP daemon not found in process list"
Display --indent 2 --text "- Checking running NTP daemon (ntpd)" --result "NOT FOUND" --color WHITE
Display --indent 4 --text "- Daemon: ntpd" --result FOUND --color GREEN
fi
# Check time daemon (eg NetBSD)
IsRunning timed
if [ ${RUNNING} -eq 1 ]; then
FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="timed"
Display --indent 2 --text "- Checking running NTP daemon (timed)" --result FOUND --color GREEN
else
Display --indent 2 --text "- Checking running NTP daemon (timed)" --result "NOT FOUND" --color WHITE
Display --indent 4 --text "- Daemon: timed" --result FOUND --color GREEN
fi
# Check time daemon (eg DragonFly BSD)
IsRunning dntpd
if [ ${RUNNING} -eq 1 ]; then
FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="dntpd"
Display --indent 2 --text "- Checking running NTP daemon (dntpd)" --result FOUND --color GREEN
else
Display --indent 2 --text "- Checking running NTP daemon (dntpd)" --result "NOT FOUND" --color WHITE
Display --indent 4 --text "- Daemon dntpd" --result FOUND --color GREEN
fi
# Check timedate daemon (systemd)
if [ ! "${TIMEDATECTL}" = "" ]; then
FIND=`${TIMEDATECTL} status | grep "NTP enabled: yes"`
if [ "${FIND}" = "" ]; then
if [ ! "${FIND}" = "" ]; then
FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="timedated"
Display --indent 2 --text "- Checking running NTP daemon (timedated)" --result "NOT FOUND" --color WHITE
else
Display --indent 2 --text "- Checking running NTP daemon (timedated)" --result "FOUND" --color GREEN
Display --indent 4 --text "- Daemon: timedated" --result "FOUND" --color GREEN
fi
fi
@ -99,8 +90,7 @@
logtext "Test: checking for ntpdate or rdate in crontab file ${I}"
FIND=`cat ${I} | ${EGREPBINARY} "ntpdate|rdate" | grep -v '^#'`
if [ ! "${FIND}" = "" ]; then
FOUND=1;
NTP_CONFIG_TYPE_SCHEDULED=1
FOUND=1; NTP_CONFIG_TYPE_SCHEDULED=1
Display --indent 2 --text "- Checking NTP client in crontab file (${I})" --result FOUND --color GREEN
logtext "Result: found ntpdate or rdate reference in crontab file ${I}"
else