shellcheck: check exit code directly

This commit is contained in:
Simon Biewald 2020-07-10 00:40:36 +02:00
parent 9107867fa1
commit 092fe08c40
No known key found for this signature in database
GPG Key ID: DAD5F452603F1344
1 changed files with 1 additions and 2 deletions

View File

@ -86,9 +86,8 @@
# Reason: openntpd syncs only if large time corrections are not required or -s is passed. # 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!) # This might be not intended by the administrator (-s is NOT the default!)
FIND=$(${PSBINARY} ax | ${GREPBINARY} "ntpd: ntp engine" | ${GREPBINARY} -v "grep") 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 # 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" FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="openntpd"
LogText "result: found openntpd (method: ntpctl)" LogText "result: found openntpd (method: ntpctl)"
OPENNTPD_COMMUNICATION=1 OPENNTPD_COMMUNICATION=1