/[mdap]/lib/MDAP/DHCP.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/MDAP/DHCP.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 52 - (show annotations)
Fri Nov 16 17:45:21 2007 UTC (16 years, 5 months ago) by dpavlin
File size: 680 byte(s)
 r66@brr:  dpavlin | 2007-11-16 18:03:45 +0100
 new plugin to turn DHCP server off

1 package MDAP::DHCP;
2
3 use strict;
4 use warnings;
5
6 use Module::Pluggable;
7 use Data::Dump qw/dump/;
8
9 my $debug = 0;
10 my $verbose = 1;
11
12 sub check {
13 my ( $self, $h ) = @_;
14 warn "## ",__PACKAGE__,"check(",dump($h),")" if $debug;
15
16 my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?";
17 my $dhcp = $h->{'DHCP_CONFIG'} || die "no DHCP_CONFIG?";
18
19 if ( $dhcp =~ m/\d+ server/ ) {
20 return if $1 == 0;
21
22 warn "## remove DHCP $dhcp $serial ",
23 $h->{'_VARIANT_FRIENDLY_NAME'}, " ",
24 $h->{'_BOARD_NAME'}, " ",
25 $h->{'_BUILD'},
26 "\n" if $verbose;
27
28 return 'dhcp server config state disabled';
29 } else {
30 warn "OK ",__PACKAGE__," $serial $dhcp\n" if $verbose;
31 return;
32 }
33 }
34
35 1;

  ViewVC Help
Powered by ViewVC 1.1.26