# vim /mysh/ipscan.sh 

#!/bin/bash
# scan the local alive ipaddress
# 2016-09-24


if [ -f $filename ];then
   echo "the file is exist" 
 for n in {100..106};do
      host=192.168.0.$n
      ping -c2 $host &>/dev/null
      if [ $? = 0 ];then
         echo "$host is up"
         echo "$host" >> /root/alive.txt
      else
          echo "$host is Down"
      fi
   done
      echo "------------------`date +"%Y-%m-%d"`-------------------------------"
 else
   echo "the file is not exist"
   touch /root/alive.txt
fi

   

相关文章:

  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-04-09
  • 2022-12-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案