summaryrefslogtreecommitdiffstats
path: root/config-db/slxconfig-demuxer
diff options
context:
space:
mode:
authorOliver Tappe2006-10-29 14:45:03 +0100
committerOliver Tappe2006-10-29 14:45:03 +0100
commit425ca246b826a52fab2481681da31a5d35d0f212 (patch)
tree068af2159b68de238bbaf3fc893be96cb65dc91d /config-db/slxconfig-demuxer
parent* added transparent mechanism for generating placeholders (diff)
downloadcore-425ca246b826a52fab2481681da31a5d35d0f212.tar.gz
core-425ca246b826a52fab2481681da31a5d35d0f212.tar.xz
core-425ca246b826a52fab2481681da31a5d35d0f212.zip
* 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
Diffstat (limited to 'config-db/slxconfig-demuxer')
-rwxr-xr-xconfig-db/slxconfig-demuxer26
1 files changed, 24 insertions, 2 deletions
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