github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/tests/upstream_switch/chk_mysql.sh (about)

     1  #!/bin/bash
     2  counter=$(netstat -na | grep "LISTEN" | grep "3306" | wc -l)
     3  if [ "${counter}" -eq 0 ]; then
     4  	/etc/init.d/keepalived stop
     5  else
     6  	exit 0
     7  fi