#!/bin/bash
function detect(){
ping=`ping -c 1 $1 &>/dev/null`
}
for i in {0..254};do
detect 193.168.1.$i
if [ $? -eq 0 ];then
echo -e " 33[32mIP 193.168.1.$i is up 33[0m"
else
echo -e " 33[31mIP 193.168.1.$i is down 33[0m"
fi
done