#!/bin/bash if test "$1" = "" then IPBASE=192.168.1 else IPBASE=$1 fi if test "$2" = "" then LL=1 else LL=$2 fi if test "$3" = "" then UL=254 else UL=$3 if test $LL -gt $UL then echo Error: Lower Limit is greater that Upper Limit exit 1 fi fi while test $LL -le $UL; do IP=$IPBASE.$LL; if ping -c 1 -w 1 $IP> /dev/null; then IPRESULT=OCCUPIED; else IPRESULT=FREE; fi echo "$IP $IPRESULT" LL=$(($LL+1)); done