shell脚本实现telnet测试服务端口
发布日期:2021-08-22 21:42:20
浏览次数:2
分类:技术文章
本文共 603 字,大约阅读时间需要 2 分钟。
备注,使用方法:当前目录下要存在需要测试的地址端口,例子:
cat ip.txt141.12.65.17 7500#!/bin/bash
cur_dir=$(pwd)ipfile=$cur_dir/ip.txtlogfile=$cur_dir/log.txtdate=date
echo "****${date}" >> $logfileif [ ! -f "$ipfile" ]; thenecho "系统检查到在当前路径下不存在要测试的地址清单,请补充ip.txt要测试的地址清单 EXIT"exitfiif [ ! -f "$logfile" ]; thentouch $cur_dir/log.txt ficat $ipfile | while read linedoresult=echo -e "\n" | telnet $line 2> /dev/null | grep Connected | wc -l
if [ $result -eq 1 ]; thenecho " $line network is nomral" >> $logfileelseecho " $line network is warried" >> $logfilefidone 转载于:https://blog.51cto.com/ssunandmoon/2379024
转载地址:https://blog.csdn.net/weixin_33755847/article/details/92504051 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
网站不错 人气很旺了 加油
[***.192.178.218]2024年03月20日 12时21分34秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Linux
2019-04-26
jmeter-性能测试基础
2019-04-26
unittest
2019-04-26
错误推断法-维护中
2019-04-26
AJAX教程
2019-04-26
git基础
2019-04-26
git基础-01
2019-04-26
mysql-总结
2019-04-26
IPv4地址
2019-04-26
正则表达式
2019-04-26
redis
2019-04-26
术语-维护中
2019-04-26
software
2019-04-26
idea-ide
2019-04-26
technology
2019-04-26
spider-02
2019-04-26
spider-03
2019-04-26
spider-04
2019-04-26
spider-05
2019-04-26
spider-06
2019-04-26