summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-31 16:40:33 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-31 16:40:33 +0000
commit1fc52ee53fcbe5917db530a057ddf9d052e2a672 (patch)
treeba61d7365fc43b22433a68055c52316301319a38 /perl-install
parent2ddf5679400aa56e9ee4b0f2e92f1313daffc7eb (diff)
downloaddrakx-backup-do-not-use-1fc52ee53fcbe5917db530a057ddf9d052e2a672.tar
drakx-backup-do-not-use-1fc52ee53fcbe5917db530a057ddf9d052e2a672.tar.gz
drakx-backup-do-not-use-1fc52ee53fcbe5917db530a057ddf9d052e2a672.tar.bz2
drakx-backup-do-not-use-1fc52ee53fcbe5917db530a057ddf9d052e2a672.tar.xz
drakx-backup-do-not-use-1fc52ee53fcbe5917db530a057ddf9d052e2a672.zip
initial deployment server support
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm25
-rw-r--r--perl-install/install_steps.pm1
2 files changed, 26 insertions, 0 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index b5e6d7526..ca1f00a2e 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1930,6 +1930,31 @@ sub move_clp_to_disk {
}
}
+sub deploy_server_notify {
+ my ($o) = @_;
+ my $fallback_intf = "eth0";
+ my $fallback_port = 3710;
+
+ my ($server, $port) = $o->{deploy_server} =~ /^(.*?)(?::(\d+))?$/;
+ if ($server) {
+ require network::tools;
+ require IO::Socket;
+ $port ||= $fallback_port;
+ my $intf = network::tools::get_current_gateway_interface() || $fallback_intf;
+ my $mac = c::get_hw_address($intf);
+ my $sock = IO::Socket::INET->new(PeerAddr => $server, PeerPort => $port, Proto => 'tcp');
+ if ($sock) {
+ print $sock "$mac\n";
+ close($sock);
+ log::l(qq(successfully notified deploy server $server on port $port));
+ } else {
+ log::l(qq(unable to contact deploy server $server on port $port));
+ }
+ } else {
+ log::l(qq(unable to parse deploy server in string $o->{deploy_server}));
+ }
+}
+
#-###############################################################################
#- pcmcia various
#-###############################################################################
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 606df646e..dc102aa52 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -946,6 +946,7 @@ Beware that some Mandriva Linux tools rely on the contents of some
of these files... so remove any file from here at your own
risk!
" };
+ install_any::deploy_server_notify($o) if exists $o->{deploy_server};
#- wait for remaining processes.
foreach (@{$o->{waitpids}}) {
waitpid $_, 0;