From 78d54215950fd0ac72c486185b9a291d270fea36 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Thu, 1 Sep 2005 14:58:13 +0000 Subject: ipdate data systems from file and from SimpleList --- drakpxelinux.pl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'drakpxelinux.pl') diff --git a/drakpxelinux.pl b/drakpxelinux.pl index d8d6ba7..f4cd7fa 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -955,9 +955,20 @@ sub get_profile2_from_mac { } sub update_systems_data { -# my ($systems) = @_; - my ($mac , $name, $entry); + my ($mac , $name, $profile2, $entry); print Dumper($systems); + foreach $a (@{$systems->{data}}) { + $mac = $a->[0]; + $name = $a->[3]; + $profile2 = $a->[2]; + $entry = [ $mac ]; + $profile2 and $a->[2] = $profile2; + $name and $a->[3] = $name; + } +} + +sub update_systems_data_from_file { + my ($mac , $entry); foreach $a (@{$systems->{data}}) { $mac = $a->[0]; $entry = [ $mac ]; @@ -969,6 +980,7 @@ sub update_systems_data { } } + sub add_configured_mac_addresses() { my ($name); while (my ($mac_address, $conf) = each %{$profiles_conf->{per_mac}}) { @@ -1117,6 +1129,7 @@ my $okcancel = create_okcancel({ cancel_clicked => sub { ugtk2->exit }, ok_clicked => sub { write_conf(get_pxelinux_conf_from_profile(), $treeview); + write_profile_conf(); ugtk2->exit }, }, ); @@ -1203,7 +1216,7 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [ }), gtksignal_connect(gtknew('Button', text => N("Set Profile 2")), clicked => sub { my $profile = $profiles_combo->get_active_text; - my $to_install = exists $profiles_conf->{profiles}{install}{$profile}; + #my $to_install = exists $profiles_conf->{profiles}{install}{$profile}; foreach ($systems->get_selected_indices) { my $entry = $systems->{data}[$_]; system_entry_set_profile2($entry, $profile); @@ -1224,8 +1237,7 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [ ); add_configured_mac_addresses(); -update_systems_data(); -write_profile_conf(); +update_systems_data_from_file(); get_mac_addresses_from_dhcp_log(); Glib::Timeout->add(60000, \&get_mac_addresses_from_dhcp_log); refresh_profiles(); -- cgit v1.2.1