From 425ca246b826a52fab2481681da31a5d35d0f212 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 29 Oct 2006 13:45:03 +0000 Subject: * added stub for DHCP-exporter and adjusted config-demuxer to use it. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@485 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'config-db/slxconfig-demuxer') diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 6b82e9d6..2bc907c5 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -51,6 +51,8 @@ MENU MASTER PASSWD secret ]; my ( + $dhcpType, + # type of DHCP export format $dryRun, # dryRun won't touch any file $systemConfCount, @@ -62,10 +64,11 @@ my ( $versionReq, ); +$dhcpType = 'ISC'; + GetOptions( + 'dhcp-type=s' => \$dhcpType, 'dry-run' => \$dryRun, - # dry-run doesn't write anything, just prints statistic about what - # would have been written 'help|?' => \$helpReq, 'man' => \$manReq, 'version' => \$versionReq, @@ -323,6 +326,18 @@ sub writeSystemPXEFiles } } +sub writeDhcpConfig +{ + return unless defined $dhcpType; + my $dhcpModule = "OpenSLX::Export::DHCP::$dhcpType"; + if (!eval "require $dhcpModule") { + die _tr("unable to load DHCP-Export backend '%s'! (%s)\n", $dhcpModule, $@); + } + my $dhcpBackend = $dhcpModule->new(); + my @clients = fetchClientsByFilter($openslxDB); + $dhcpBackend->execute(\@clients); +} + sub writeClientConfigurationsForSystem { my $system = shift; @@ -383,6 +398,7 @@ sub writeConfigurations $systemConfCount = $clientSystemConfCount = 0; writeSystemConfigurations(); writePXEMenus(); + writeDhcpConfig(); } __END__ @@ -396,6 +412,7 @@ slxconfig-demuxer - OpenSLX configuration demultiplexer slxconfig-demuxer [options] Script Options: + --dhpc-type=s specifies the type of DHCP-server (ISC,...) --dry-run avoids writing anything, for testing OpenSLX Options: @@ -428,6 +445,11 @@ slxconfig-demuxer [options] =over 8 +=item B<--dhcp-type> + +Specifies the type of DHCP-export that shall be used. Currently, only 'ISC' is +supported. + =item B<--dry-run> Runs the script but avoids writing anything. This is useful for testing, as -- cgit v1.2.3-55-g7522