From: Dobrica Pavlinusic Date: Sun, 3 Apr 2022 18:44:53 +0000 (+0200) Subject: fix hostname extraction X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=52d14d3543bfa426e61475b1a98917141666e2bc;hp=fcb8c1c39468f1e3c42dc8a39e2fc3b8c9b437fa;p=dell-switch fix hostname extraction --- diff --git a/dell-switch.pl b/dell-switch.pl index 3246fc1..3c990c8 100755 --- a/dell-switch.pl +++ b/dell-switch.pl @@ -99,7 +99,7 @@ while() { } elsif ( $buff =~ m/Password:/ ) { send_pty "$passwd\n"; $buff = ''; - } elsif ( $buff =~ m/([\w\-\(\)]+)#$/ ) { + } elsif ( $buff =~ m/[\n\r]([\w\-\(\)]+)#$/ ) { my $hostname = $1; if ( $buff ) { save_log $ip, $hostname, $command, $buff;