summaryrefslogtreecommitdiffstats
path: root/drakpxelinux.pl
diff options
context:
space:
mode:
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r--drakpxelinux.pl22
1 files changed, 17 insertions, 5 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index d8d6ba7..f4cd7fa 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -955,11 +955,22 @@ 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 ];
my $profile2 = get_profile2_from_mac($mac);
my $name = get_name_from_mac($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();