Shell script batch Telnet IP Port

Source: Internet
Author: User

Check the HTTP proxy to check whether the proxy service is normal. You need to ping the XXXXX port on the proxy machine.

Because the number of machines is too large, You Need To Batch Execute Telnet commands.

The script is as follows:

 

Port = xxxxxcount = 0for I in $ (cat ip_list.dat) Do (count ++) echo "Count = $ count" # keyCode, 1 s automatically ends telnet (sleep 1 ;) | Telnet $ I $ port> telnet_result.txtdone # Ping ipcat telnet_result.txt | grep-B 1 \] | grep [0-9] | awk '{print $3} '| cut-d '. '-F, 3, 4> telnet_alive.txt # difference set to ping different ipcat ip_list.dat telnet_alive.txt | sort | uniq-u> telnet_die.txt

 

Refer:

Http://blog.csdn.net/edei2004/article/details/3694021

 

 

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.