国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

一個可交互的并發ping檢測腳本

2019-10-26 18:35:32
字體:
來源:轉載
供稿:網友
代碼如下:
#!/bin/bash
#********************************#
#2013-01-11 17:00:00 wanggy exp  #
#note:ping monitor               #
#********************************#
set -u
ping_fun()
{
    d_network=192.168.1
    echo -n "input the network(default $d_network):"
    read network
    : ${network:=$d_network}
    echo "network:$network"
    d_hostip_beg=1
    d_hostip_end=254
    echo -n "input the hostip(default $d_hostip_beg $d_hostip_end):"
    read hostip_beg hostip_end
    : ${hostip_beg:=$d_hostip_beg}
    : ${hostip_end:=$d_hostip_end}
    echo "hostip_beg:$hostip_beg"
    echo "hostip_end:$hostip_end"
            if [ $hostip_beg -gt $hostip_end ];then
                    echo "$hostip_beg greater than $hostip_end!!!"
                    exit 0
            fi
    : >pinglog
    : >pingerrlog
    ping_count=3
    for ((hostip=$hostip_beg;hostip<=$hostip_end;hostip++));do
    {
            host=$network.$hostip
            echo "開始ping檢測$host"
            ping -c $ping_count $host >/dev/null
                    if [ $? = 0 ];then
                            echo "$host is up"
                            echo "$host is up" >>pinglog
                    else
                                    echo "$host is down"
                                    echo "$host is down" >>pingerrlog
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 德阳市| 太康县| 安陆市| 广安市| 墨竹工卡县| 厦门市| 呼图壁县| 读书| 辰溪县| 轮台县| 平利县| 上杭县| 兰州市| 延吉市| 苏尼特左旗| 舞阳县| 静安区| 云林县| 沂水县| 方城县| 诸城市| 烟台市| 海盐县| 台北市| 苏尼特左旗| 湘西| 叙永县| 金乡县| 旬邑县| 南汇区| 甘南县| 罗田县| 松阳县| 晋城| 九龙城区| 平湖市| 朝阳区| 大埔县| 莱西市| 广丰县| 清涧县|