1 2 3 4 5 6 7 8 9 10
#!/bin/bash SERVICE=$(cat /opt/config/service.txt) PID=$(pgrep $SERVICE) if [[ -z $PID ]]; then echo "unhealthy" > status.txt else echo "healthy" > status.txt fi