- 论坛徽章:
- 0
|
环境: redhat9
- #!/bin/sh
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
- #############################################################
- # This is a script that tests if network is well! #
- # created by irror #
- # CopyRight by CU #
- #############################################################
-
- #
- #cat .tmp | sed 's/icmp_seq=//g' | awk '{print $5,$1,$2,$3,$4,$6,$7}'| sed 'n;n;n;G' >;>; $SIP.txt 2>;&1
- #
-
- SIP=192.168.100.40 #insert your ip address
- DATE=`date +%c`
-
- #############you'd better not modify the underline############
- echo "------------Begin at $DATE-------------" >;$SIP.txt 2>;&1
- ping $SIP >; .tmp 2>;&1
- cat .tmp | awk '/^64/' | awk '{i++;n=substr($5,10);for (;n-i>;0;i++){print "request timeout"}print $0}' | sed 'n;n;n;G' >;>;$SIP.txt 2>;&1
- echo "-------------End at `date +%c`--------------" >;>;$SIP.txt 2>;&1
- rm -rf .tmp
复制代码 |
|