1 2 3 4 5 6 7 8
#!/bin/bash PID=$(service bind9 status | grep inactive) if [[ -z $PID ]]; then echo "healthy" > status.txt else echo "unhealthy" > status.txt fi