FRITZBOX: Telnet error - Login failed.

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7362 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch
2014-12-29 19:17:41 +00:00
parent 44e8fe2eaa
commit f283b919c2

View File

@@ -1445,9 +1445,17 @@ sub FRITZBOX_Open_Connection($)
$telnet->print( $pwd ); $telnet->print( $pwd );
FRITZBOX_Log $hash, 5, "Wait for command prompt"; FRITZBOX_Log $hash, 5, "Wait for command prompt";
unless ($telnet->waitfor( '/# $/i' )) unless ( ($before,$match) = $telnet->waitfor( '/# $|Login failed./i' ))
{ {
$msg = "Telnet error while waiting for command prompt (perhaps wrong password): ".$telnet->errmsg; $msg = "Telnet error while waiting for command prompt: ".$telnet->errmsg;
FRITZBOX_Log $hash, 2, $msg;
$telnet->close;
$telnet = undef;
return $msg;
}
elsif ( $match eq "Login failed.")
{
$msg = "Telnet error: Login failed. Wrong password.";
FRITZBOX_Log $hash, 2, $msg; FRITZBOX_Log $hash, 2, $msg;
$telnet->close; $telnet->close;
$telnet = undef; $telnet = undef;