diff options
author | Antoine Ginies <aginies@mandriva.com> | 2005-09-02 10:14:46 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2005-09-02 10:14:46 +0000 |
commit | 02b02783bfc8743bd703908f06945129625f0c8a (patch) | |
tree | f4faff24935ee5af9603ea4a12f9bfb54d5b5fe2 /drakpxelinux.pl | |
parent | 2b98c369326c4e8bb2358fedd8bbabbd11b609cc (diff) | |
download | drakpxelinux-02b02783bfc8743bd703908f06945129625f0c8a.tar drakpxelinux-02b02783bfc8743bd703908f06945129625f0c8a.tar.gz drakpxelinux-02b02783bfc8743bd703908f06945129625f0c8a.tar.bz2 drakpxelinux-02b02783bfc8743bd703908f06945129625f0c8a.tar.xz drakpxelinux-02b02783bfc8743bd703908f06945129625f0c8a.zip |
fix pb of duplicate entry in systems tab (need to update systems avec get all mac addr)
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r-- | drakpxelinux.pl | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl index 1700a69..0aedd3f 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -976,27 +976,16 @@ sub add_configured_mac_addresses() { } } -sub first_get_all_mac { - my %addresses; - foreach (cat_("/var/log/daemons/info")) { - /dhcpd:\s+DHCP(?:DISCOVER|REQUEST).*\s+from\s+($mac_regexp)\b/ and $addresses{$1} = 1; - } - foreach (keys %addresses) { - my $entry = [ $_ ]; - push @{$systems->{data}}, $entry; - } -} - sub get_mac_addresses_from_dhcp_log() { my %addresses; foreach (cat_("/var/log/daemons/info")) { /dhcpd:\s+DHCP(?:DISCOVER|REQUEST).*\s+from\s+($mac_regexp)\b/ and $addresses{$1} = 1; } foreach (difference2([ keys %addresses ], [ map { $_->[0] } @{$systems->{data}} ])) { - my $entry = [ $_ ]; - system_entry_set_profile($entry, ''); - push @{$systems->{data}}, $entry; - gtktext_append($log_text, "Detected new system: $_\n"); + my $entry = [ $_ ]; + system_entry_set_profile($entry, ''); + push @{$systems->{data}}, $entry; + gtktext_append($log_text, "Detected new system: $_\n"); } 1; #- run callback on next timeout } @@ -1224,9 +1213,8 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [ ); add_configured_mac_addresses(); -first_get_all_mac(); -update_systems_data_from_file(); get_mac_addresses_from_dhcp_log(); +update_systems_data_from_file(); Glib::Timeout->add(60000, \&get_mac_addresses_from_dhcp_log); refresh_profiles(); $w->show; |