一个验证业务机与DB的联通性的小工具
#!/bin/bash # 请求全部业务机上操作DB的接口,测试联通性 ips=(47.75.217.22, 47.75.217.23, 47.75.217.24, 47.75.217.25, 47.75.217.26) if [ x$1 != x ]; then mod=$1 else mod="r" fi for ip in ${ips[@]}; do curl -x "$ip:80" "http://i.niliu.me/api/dbconn?cip=$ip&mod=$mod" echo "ok" done