diff options
author | Simon Biewald <simon@fam-biewald.de> | 2020-07-10 01:40:36 +0300 |
---|---|---|
committer | Simon Biewald <simon@fam-biewald.de> | 2020-07-10 01:40:36 +0300 |
commit | 092fe08c400a0b7eb4f6ace7ac4ebaf6c4c9bec6 (patch) | |
tree | e6788c58d444e457de06f63510e96b00edb90dd9 /include/tests_time | |
parent | 9107867fa1307a7ec65f250efbc2440665078fb0 (diff) |
shellcheck: check exit code directly
Diffstat (limited to 'include/tests_time')
-rw-r--r-- | include/tests_time | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/tests_time b/include/tests_time index eee5cbfc..c85e2876 100644 --- a/include/tests_time +++ b/include/tests_time @@ -86,9 +86,8 @@ # Reason: openntpd syncs only if large time corrections are not required or -s is passed. # This might be not intended by the administrator (-s is NOT the default!) FIND=$(${PSBINARY} ax | ${GREPBINARY} "ntpd: ntp engine" | ${GREPBINARY} -v "grep") - ${NTPCTLBINARY} -s status > /dev/null 2> /dev/null # Status code 0 is when communication over the socket is successfull - if [ "$?" -eq 0 ]; then + if ${NTPCTLBINARY} -s status > /dev/null 2> /dev/null; then FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="openntpd" LogText "result: found openntpd (method: ntpctl)" OPENNTPD_COMMUNICATION=1 |