#!/bin/bash
PREFIX=192.168.1
NODE=1
while [ "$NODE" -lt "255" ]; do
echo -en "Pinging ${PREFIX}.${NODE}..."
ping -c1 -w1 -t5 ${PREFIX}.${NODE} >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo "OK"
else
echo "Failed"
fi
let NODE=$NODE+1
done
时间: 2024-11-09 02:20:48