[root@docker-node1 ]# cat ping.sh

#!/bin/bash
. /etc/init.d/functions
for var in {1..254};
do
ip=192.168.0.$var
ping -c2 $ip >/dev/null 2>&1
if [ $? = 0 ];then
action "$ip" /bin/true
else
action "$ip" /bin/false
fi
done

#运行脚本:

chmod +x ping.sh

sh ping.sh

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2021-12-08
  • 2021-12-21
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2021-09-21
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-12-07
相关资源
相似解决方案