check_email_deliverer_process: Fix shellcheck warnings.

In puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_process line 16:
elif [ "$(echo "$STATUS" | egrep '(STOPPED)|(STARTING)|(BACKOFF)|(STOPPING)|(EXITED)|(FATAL)|(UNKNOWN)$')" ]
       ^-- SC2143: Use egrep -q instead of comparing output with [ -n .. ].
                           ^-- SC2196: egrep is non-standard and deprecated. Use grep -E instead.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-03 00:14:44 +00:00 committed by Tim Abbott
parent e3253a7a1b
commit eb4855b77b
1 changed files with 17 additions and 15 deletions

View File

@ -9,18 +9,20 @@ SUPERVISOR_STATUS=$(supervisorctl status zulip-workers:zulip-deliver-enqueued-em
STATUS=$(echo "$SUPERVISOR_STATUS" | awk '{ print $2 }') STATUS=$(echo "$SUPERVISOR_STATUS" | awk '{ print $2 }')
if [ "$STATUS" == "RUNNING" ] case "$STATUS" in
then RUNNING)
echo "Running" echo "Running"
exit 0 exit 0
elif [ "$(echo "$STATUS" | egrep '(STOPPED)|(STARTING)|(BACKOFF)|(STOPPING)|(EXITED)|(FATAL)|(UNKNOWN)$')" ] ;;
then STOPPED|STARTING|BACKOFF|STOPPING|EXITED|FATAL|UNKNOWN)
# not "RUNNING", but a recognized supervisor status # not "RUNNING", but a recognized supervisor status
echo "$STATUS" echo "$STATUS"
exit 1 exit 1
else ;;
# we don't recognize the second column in this SUPERVISOR_STATUS. *)
# This may be indicative of a supervisor configuration problem # we don't recognize the second column in this SUPERVISOR_STATUS.
echo "$SUPERVISOR_STATUS" # This may be indicative of a supervisor configuration problem
exit 3 echo "$SUPERVISOR_STATUS"
fi exit 3
;;
esac