#!/bin/bash PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH systemctl status gearmand | grep -q "running" if [ $? -eq 1 ] ; then systemctl start gearmand; LOG="Nao foi encontrado gearman. Servico gearman foi iniciado. " fi systemctl status supervisord | egrep -q "running" if [ $? -eq 1 ] ; then systemctl start supervisord; LOG=$LOG"Nao foi encontrado supervisor. Servico supervisor foi iniciado. "; else COMMAND=$(ps -C php -f | grep -o "PendenciasTramiteRN.php"); if [ -z "$COMMAND" ] then systemctl restart supervisord; LOG=$LOG"Nao foi encontrado PendenciasTramiteRN. Servico supervisor foi reiniciado. " fi COMMAND=$(ps -C php -f | grep -o "ProcessarPendenciasRN.php"); if [ -z "$COMMAND" ] then systemctl restart supervisord; LOG=$LOG"Nao foi encontrado ProcessarPendenciasRN. Servico supervisor foi reiniciado. " fi fi if [ -n "$LOG" ] then #/usr/bin/php console.php log --msg="$LOG" > /dev/null echo $LOG fi