<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
use strict;
use warnings;

use Getopt::Long;
use Pod::Usage;

use IO::Socket;
use Net::Wake;


my $VERSION = 0.1;

=head1 NAME

'wol.pl' is simple console based script to boot machines!.

=head1 SYNOPSIS

  #to boot a machine.
  wol.pl --mac '&lt;mac-address&gt;'

  #to boot multiple machines.
  wol.pl --mac '&lt;mac-address&gt;' --mac '&lt;mac-address&gt;' --mac '&lt;mac-address&gt;'...

  wol.pl --man for more details.


=head1 DESCRIPTION

`wol.pl` is a simple console based script to boot machines remotely.
It takes n number of mac addresses as arguments and it
gives a boot call to the remote machines in sequence.

Obvisouly, the system that you are trying to boot should have appropriate BIOS settings
to manage this. Set up Wake-on-lan settings appropriately and then use the script. 

=head1 PREREQUISITES

`wol.pl` depends on the following modules:

  - C&lt;IO::Socket&gt;
  - C&lt;Net::Wake&gt;
  - C&lt;Getopt::Long&gt;
  - C&lt;Pod::Usage&gt;

=cut


# Set up defaults
my $verbose = 0;
my $help    = undef;
my $man     = undef;
my @macs;

GetOptions(  'help' =&gt; \$help,
              'man' =&gt; \$man,
           'macs=s' =&gt; \@macs);

pod2usage (-verbose =&gt; 2) if $man;
pod2usage (1)             if $help or not @macs;

Net::Wake::by_udp(undef,$macs[$_]) for (0..$#macs);


=head1 AUTHOR

ramki &lt;ramki.s@gmail.com&gt;

=head1 BUGS

Please report to the author.

=head1 SCRIPT CATEGORIES

UNIX/System_administration

Networking

=head1 COPYRIGHT

Copyright 2005 Ramakrishnan S

This program is free software; you can redistribute it and/or modify it under
 the same terms as Perl itself.
</pre></body></html>