端午
快乐
一个简单的检测网络Shell脚本 – 海南仙岛

一个简单的检测网络Shell脚本

2016年09月9日

原创内容,转载请注明出处: https://www.myzhenai.com.cn/post/2309.html https://www.myzhenai.com/thread-17923-1-1.html
关键词: Shell判断变量是否为空 Shell判断参数是否为空 Shell检测网络 Shell ping Shell traceroute

Shell ping Shell traceroute

Shell ping Shell traceroute


Shell ping Shell traceroute

Shell ping Shell traceroute


其实这个Shell脚本就是简单的将ping和traceroute集合在一起. 因为我总是会忘记traceroute的拼法.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# !/bin/bash
##############################################################################################################################################
# This is the Network detection script tool
# Author: RucLinux 海南胡说 海南仙岛
# Website: www.myzhenai.com www.myzhenai.com.cn www.haikou-china.com jiayu.mybabya.com www.0898-shop.com
##############################################################################################################################################
if [ ! -n $1 ];then
echo "You did not enter a URL or IP"
else
p=`ping -c 5 $1`
echo -e "$p\n"
t=`traceroute $1`
echo -e "$t\n"
fi
# !/bin/bash ############################################################################################################################################## # This is the Network detection script tool # Author: RucLinux 海南胡说 海南仙岛 # Website: www.myzhenai.com www.myzhenai.com.cn www.haikou-china.com jiayu.mybabya.com www.0898-shop.com ############################################################################################################################################## if [ ! -n $1 ];then echo "You did not enter a URL or IP" else p=`ping -c 5 $1` echo -e "$p\n" t=`traceroute $1` echo -e "$t\n" fi
# !/bin/bash
##############################################################################################################################################
# This is the Network detection script tool
# Author: RucLinux 海南胡说 海南仙岛
# Website: www.myzhenai.com www.myzhenai.com.cn www.haikou-china.com jiayu.mybabya.com www.0898-shop.com
##############################################################################################################################################
if [ ! -n $1 ];then
echo "You did not enter a URL or IP"
else
p=`ping -c 5 $1`
echo -e "$p\n"
t=`traceroute $1`
echo -e "$t\n"
fi

 


sicnature ---------------------------------------------------------------------
I P 地 址: 3.142.201.19
区 域 位 置: 美国
系 统 信 息: 美国
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://myzhenai.com/post/2309.html

没有评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注