0
点赞
收藏
分享

微信扫一扫

linux中shell脚本监控端口或者接口是否正常访问


1.监听端口
sudo vim check-port.sh

#! /bin/bash
ETMPORT=$(netstat -alnt|grep -c ":9443");
while [ ${ETMPORT} -eq 0 ]; do
sleep 10;
ETMPORT=$(netstat -alnt|grep -c ":9443");
done
kill `ps -ef|grep chrome | awk '{print $2}'|head -1`;
google-chrome-stable --kiosk --noerrdialogs -start-fullscreen http://localhost:9527


举报

相关推荐

0 条评论