Created
September 19, 2019 12:55
-
-
Save rmsaitam/69c9be253d1c2f1abb0dbcc01fc5ec11 to your computer and use it in GitHub Desktop.
Verifica se o serviço está parado e inicializa o serviço novamente
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#lista a quantidade de registros | |
#substituir <service-name> | |
QUANTIDADE="`ls | ps -e -o comm | grep <service-name> | wc -l`" | |
#se $QUANTIDADE for menor que 1: | |
if [ $QUANTIDADE -lt 1 ]; | |
then | |
#ativa o serviço | |
service <service-name> start | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment