From 35478e4bc0c788902f802e65ee7dfd09d10b58a6 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Wed, 14 Sep 2005 15:55:31 +0000 Subject: - auto_install: test perl script - catch USR1 signal to update systems tab --- drakpxelinux.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drakpxelinux.pl') diff --git a/drakpxelinux.pl b/drakpxelinux.pl index 7733118..5a5d1f5 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -483,7 +483,10 @@ sub edit_box_item { # create file dialog widget, with file or directory selection my $fdwidget = sub { my ($data, $test, $filetotest, $label, $profile) = @_; - chdir($network::pxe::pxelinux_client_root); + if ($filetotest eq "auto_install") { + chdir($network::pxe::pxelinux_client_root . "/pxelinux.cfg/profiles/"); + } else { chdir($network::pxe::pxelinux_client_root); + } my $fd = new Gtk2::FileSelection(N("Selection")); $fd->set_modal(1); $fd->signal_connect("destroy", sub { $fd->hide }); @@ -510,6 +513,7 @@ sub edit_box_item { $data->set_text("images/$label.img"); } } elsif ($filetotest eq "auto_install") { + run_program::get_stdout("file $file") =~ /perl/ or err_dialog(N("Error!"), N("Should be a perl script")) and \return; my $ip_address = network::tools::get_interface_ip_address($net, $interface); run_program::get_stdout("cp -avf $file " . $network::pxe::pxelinux_client_root . "/pxelinux.cfg/profiles/auto_" . $profile . "_" . $label . ".pl"); $data->set_text("http://$ip_address:3712/auto_" . $profile . "_" . $label . ".pl"); @@ -1253,6 +1257,9 @@ add_local_profil_entry(); add_configured_mac_addresses(); get_mac_addresses_from_dhcp_log(); update_systems_data_from_file(); +$SIG{USR1} = sub { + update_systems_data_from_file(); +}; Glib::Timeout->add(60000, \&get_mac_addresses_from_dhcp_log); refresh_profiles(); $w->show; -- cgit v1.2.1