首页 > 系统服务 > 详细

1,shell 批量验证防火墙端口是否开通

时间:2020-08-21 22:08:37      阅读:106      评论:0      收藏:0      [点我收藏+]
[root@db-gitlab-harbor ~]# cat /tmp/ports.txt 
192.168.0.1 22
127.0.0.1 22
127.0.0.1 222
[root@db-gitlab-harbor ~]# 
[root@db-gitlab-harbor ~]# cat telnet.sh 
#! /bin/bash

cat /tmp/ports.txt |while read line
do
	nc -z -w 10 $line >/dev/null 2>&1
	if [ $? -eq 0 ]
	  then
		echo $line:ok
	else
		echo $line:false
	fi
done
[root@db-gitlab-harbor ~]# 

1,shell 批量验证防火墙端口是否开通

原文:https://www.cnblogs.com/k8s-pod/p/13543284.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!