--- mdap-server.pl 2007/05/07 18:34:11 38 +++ mdap-server.pl 2007/05/07 19:29:05 39 @@ -16,6 +16,8 @@ my $resend_search_delay = 3; my $tftp_path = '/srv/tftp/'; +my $flashed_cmd = 'system config led=flash'; + GetOptions( "port=i" => \$PORT, "group=s" => \$GROUP, @@ -25,6 +27,7 @@ "search=i" => \$resend_search_delay, "tftp=s" => \$tftp_path, "credentials" => \$credentials, + "exec=s" => \$flashed_cmd, ); $quiet = 0 if $verbose; @@ -47,10 +50,11 @@ warn "invalid $passwd_path entry: $_\n"; } } - print "found ", $#try_accounts + 1, " accounts to try on password protected ants\n"; + print "found ", $#try_accounts + 1, " accounts to try on password protected ants", + $credentials ? " and display credentials" : "", "\n"; } -warn "search for ants every ${resend_search_delay}s\ntftp server path: $tftp_path\n"; +warn "search for ants every ${resend_search_delay}s\ntftp server path: $tftp_path\nflashed to current version: $flashed_cmd\n"; sub fw { my ($board, $offset,$len) = @_; @@ -240,7 +244,7 @@ $ant_flashing->{$ant} = 0; # green|red|orange|flash|off - mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:system config led=flash\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); + mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:$flashed_cmd\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); my $waiting = 0; my $count = 0; map { @@ -258,11 +262,12 @@ once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; } } elsif ( $type eq 'REPLY-EXEC-CLI' ) { - print "+ $type ", dump( $data ), "\n" if ($verbose); + print "+ $type\n$data\n" if ($verbose); if ( $seq_nr == 1 ) { mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nSEQ-NR:2\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); forget_ant( $ant ) if ( $ant_flashing->{$ant} ); } + } else { print "!! reply $type ignored ", dump( $h ), $/; }