检测端口是否存在

#!/bin/bash
myemail="754347404@qq.com"

file=/home/tkm/jiankongurl200/nc.txt  #txt里面写要检测端口号
for i in `cat $file`;do
   nc -w 10 -z 119.3.206.151 $i
   if [ $? -ne 0 ]
   then

   echo `date +%F-%H:%M:%S`  "119.3.206.151服务器没有 $i 这个端口" |mail -s '端口报警' $myemail >>          
/home/tkm/jiankongurl200/tkm.log
   else
   echo `date +%F-%H:%M:%S`  "119.3.206.151服务器有端口" >> /home/tkm/jiankongurl200/tkm.log
   fi
done

我来吐槽

*

*

已有 9 条评论

  1. clourgy

    Can You Take Amoxicillin With Lyica where to buy cialis cheap

  2. Twirway

    Amoxicillin Max Dose buy stromectol pills online

  3. Cetswasse

    This usually takes about 7-10 days cialis 20mg price

  4. PemnHeimb

    The Care Quality Commission CQC regulates all health and social care services in England buy priligy 60 mg

  5. estange

    Signs of a Rogue Online Pharmacy non prescription cialis online pharmacy

  6. rawAdanna

    generic cialis cost There are, however, no adequate and well-controlled studies of tadalafil in pregnant women

  7. Tedemance

    We decided to try IUI next and completed three rounds of that with still no results. how many days after clomid do you ovulate

  8. swollocky

    Does Pregnyl increase chances of twins. does nolvadex increase testosterone levels Liver toxicity as with other methylated oral steroids, SD hits your liver.

  9. highWhove

    Suffering from chronic gastritis, bitter bile reflux. doxycycline sun sensitivity In this context, it is important to understand how Cyclin E is transcriptionally regulated in pluripotent stem cells.