#!/bin/bash
# generated by getlino
set -e  # exit on error
echo "Checking supervisor status..."
ERRORS=$(sudo supervisorctl status | awk '{if ( $2 != "RUNNING" ) { print "- " $1 " is not running." }}')
if [ -z "$ERRORS" ]; then
  echo "The supervisor status looks OK"
else
  echo "ERRORS in supervisorctl status:" > /dev/stderr
  echo "$ERRORS" > /dev/stderr
  exit 1
fi
