--- lib/PXElator/wol.pm 2009/08/26 11:42:33 296 +++ lib/PXElator/wol.pm 2009/08/26 12:43:47 297 @@ -7,26 +7,25 @@ use Regexp::Common qw/net/; use client; +use server; sub power_on { my $target = shift; - my ( $port, $mac, $ip ) = ( 9 ); + my ( $port, $mac ) = ( 9 ); if ( $target =~ m/$RE{net}{MAC}{-keep}/ ) { $mac = $1; - $ip = client::ip_from_mac $1; } elsif ( $target =~ m/$RE{net}{IPv4}{-keep}/ ) { - $ip = $1; $mac = client::mac_from_ip $1; } else { die "$target isn't IP or MAC"; } - warn "# power_on $ip $mac"; + warn "# power_on $mac"; my $sock = IO::Socket::INET->new( Proto=>'udp' ); - my $ip_addr = inet_aton($ip); + my $ip_addr = inet_aton($server::bcast); my $sock_addr = sockaddr_in($port, $ip_addr); $mac =~ s{:}{}g;