Using the shell to determine the local area network users have those

Source: Internet
Author: User

#!/bin/bashwhile true; do  for i in {100..120};d o     ping -c 2 -w 2 192.168.0. $I  &>/dev/null    if [  $? -eq 0 ];then      echo -e  "\033[32;40m  192.168.0. $I  is up.\033[0m "    else      echo  -e  "\033[32;40m 192.168.0. $I  is down.\033[0m"     fi   Done    breakdone Execution Results [[email protected] ~]# sh ping.sh   192.168.0.100 is up. 192.168.0.101 is down. 192.168.0.102 is up.  192.168.0.103 is down. 192.168.0.104 is up. 192.168.0.105 is down.  192.168.0.106 is DOWN. 192.168.0.107 is DOWN. 192.168.0.108 is  down. 192.168.0.109 is up. 192.168.0.110 is down. 192.168.0.111 is down. 192.168.0.112  is DOWN. 192.168.0.113 is DOWN. 192.168.0.114 is UP.  192.168.0.115 is up. 192.168.0.116 is down. 192.168.0.117 is down.  192.168.0.118 is up. 192.168.0.119 is down. 192.168.0.120 is up.


Implementing Scenarios using Ping

ping command parameters

-D uses the So_debug function of the socket.
-c< Completion > Set the number of responses required to complete.
-F limit detection.
-i< interval seconds > Specifies the time interval between sending and receiving information.
-i< Network Interface > send out packets using the specified network interface.
-l< pre-load > Set the packets that are sent forward before sending the required information.
-n outputs only numeric values.
-p< Template Style > Set the template style that fills the packet.
- Q does not display the instruction execution process, except for the beginning and end of the relevant information.
- R ignores the normal routing Table and sends the packet directly to the remote host.
-R records the routing process.
-s< Packet Size > Set the size of the packet.
-t< Survival value > Set the size of the Live value TTL.
-V shows the execution of the instruction in detail.









This article is from the "Little Rookie" blog, please be sure to keep this source http://baishuchao.blog.51cto.com/12918589/1943027

Using the shell to determine the local area network users have those

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.