yum install net-tools
#!/usr/bin/perl $mac = "00:11:22:33:44:55"; system("ether-wake $mac"); for($i=0;$i<10;$i++){ `sleep 1`; print "."; } print "\n"; $subnet = `ifconfig |egrep -o '((10|172|192).[0-9]+.[0-9]+.)'| head -1`; $subnet =~s/[\r\n]//g; $subnet .= "0/24"; $ip = `nmap -sP $subnet |grep -i -B 2 $mac |head -1 |cut -f 5 -d" "`; print "$ip";