1 2 3 4 5 6 7 8 9
#!/usr/bin/env bash ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT) if [ "$OK" == "imok" ]; then exit 0 else exit 1 fi