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 }')
if [ "$STATUS" == "RUNNING" ]
then
echo "Running"
exit 0
elif [ "$(echo "$STATUS" | egrep '(STOPPED)|(STARTING)|(BACKOFF)|(STOPPING)|(EXITED)|(FATAL)|(UNKNOWN)$')" ]
then
# not "RUNNING", but a recognized supervisor status
echo "$STATUS"
exit 1
else
# we don't recognize the second column in this SUPERVISOR_STATUS.
# This may be indicative of a supervisor configuration problem
echo "$SUPERVISOR_STATUS"
exit 3
fi
case "$STATUS" in
RUNNING)
echo "Running"
exit 0
;;
STOPPED|STARTING|BACKOFF|STOPPING|EXITED|FATAL|UNKNOWN)
# not "RUNNING", but a recognized supervisor status
echo "$STATUS"
exit 1
;;
*)
# we don't recognize the second column in this SUPERVISOR_STATUS.
# This may be indicative of a supervisor configuration problem
echo "$SUPERVISOR_STATUS"
exit 3
;;
esac