|
|||||||||
wol の変更点
#author("2017-04-26T09:27:23+00:00","default:pentacle","pentacle")
yum install net-tools
#pre{{
#!/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";
}}
|
|||||||||