FRITZBOX: freetz bugfix

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7377 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch 2014-12-31 13:11:09 +00:00
parent 43b52070e0
commit a58230a792

View File

@ -1530,7 +1530,9 @@ FRITZBOX_Exec_Remote($$)
@output=$telnet->cmd($cmd); @output=$telnet->cmd($cmd);
$result = $output[0]; $result = $output[0];
chomp $result; chomp $result;
FRITZBOX_Log $hash, 4, "Result '$result'"; my $log = join " ", @output;
chomp $log;
FRITZBOX_Log $hash, 4, "Result '$log'";
return $result; return $result;
} }
elsif (ref \$cmd eq "REF") elsif (ref \$cmd eq "REF")
@ -1546,8 +1548,11 @@ FRITZBOX_Exec_Remote($$)
unless ($_ =~ /^sleep/) unless ($_ =~ /^sleep/)
{ {
@output=$telnet->cmd($_); @output=$telnet->cmd($_);
$result = join(" ",@output); $result = $output[0];
$result =~ s/(\r\n|\n\r|\n|\r|\s)$//; chomp $result;
my $log = join " ", @output;
chomp $log;
FRITZBOX_Log $hash, 4, "Result '$log'";
} }
else else
{ {
@ -1556,7 +1561,6 @@ FRITZBOX_Exec_Remote($$)
$result = ""; $result = "";
} }
push @resultArray, $result; push @resultArray, $result;
FRITZBOX_Log $hash, 5, "Result '$result'";
} }
@{$cmd} = (); @{$cmd} = ();
FRITZBOX_Log $hash, 4, "Received ".int(@resultArray)." answer(s)"; FRITZBOX_Log $hash, 4, "Received ".int(@resultArray)." answer(s)";