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