--- mdap-server.pl 2007/04/24 10:11:24 29 +++ mdap-server.pl 2007/04/24 15:44:20 31 @@ -11,6 +11,7 @@ my $debug = 0; my $quiet = 1; my $verbose = 0; +my $credentials = 0; my $resend_search_delay = 3; my $tftp_path = '/srv/tftp/'; @@ -23,6 +24,7 @@ "verbose!" => \$verbose, "search=i" => \$resend_search_delay, "tftp=s" => \$tftp_path, + "credentials" => \$credentials, ); $quiet = 0 if $verbose; @@ -38,7 +40,7 @@ while(<$fh>) { chomp; next if /^#/ || /^$/ || /^\s+$/; - if (/^\S+\t\S+$/) { + if (/^\S+\s\S+$/) { push @try_accounts, $_; } else { warn "invalid $passwd_path entry: $_\n"; @@ -156,6 +158,16 @@ print $m if ($once->{$m} == 1); } +my $status = ''; + +sub status { + my $m = join('', @_); + if ($m ne $status) { + print $m; + $status = $m; + } +} + local $SIG{ALRM} = sub { mdap_send("ANT-SEARCH MDAP/1.1\r\n"); alarm( $resend_search_delay ); @@ -207,6 +219,7 @@ next; } else { $ant_ok_password->{$ant}++; + print "$ant credentials $user_id $user_pwd\n" if ($credentials && $ant_ok_password->{$ant} == 1); } my $board = $h->{'_BOARD_NAME'} || die "no _BOARD_NAME?"; @@ -229,9 +242,11 @@ $waiting++ if ($ant_flashing->{$_}); $count++; } keys %$ant_flashing; - if ($ant_flashing && $waiting == 0) { - print "**** ALL $count ANTS FLASHED ****\n"; - $ant_flashing = {}; + if ($waiting == 0) { + status "ALL $count ANTS FLASHED to $build\n"; + $ant_flashing = undef; + } else { + status "$waiting of $count ants still flasing upto $build\n"; } } } else {