mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
^D (EOF) kills fhem
git-svn-id: https://svn.fhem.de/fhem/trunk@1749 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
98bc0176b2
commit
724ed8e61e
@ -56,7 +56,15 @@ telnet_Define($$$)
|
|||||||
return "Usage: define <name> telnet [IPV6:]<tcp-portnr> [global]"
|
return "Usage: define <name> telnet [IPV6:]<tcp-portnr> [global]"
|
||||||
if($port !~ m/^(IPV6:)?\d+$/ || ($global && $global ne "global"));
|
if($port !~ m/^(IPV6:)?\d+$/ || ($global && $global ne "global"));
|
||||||
|
|
||||||
return TcpServer_Open($hash, $port, $global);
|
my $ret = TcpServer_Open($hash, $port, $global);
|
||||||
|
|
||||||
|
# Make sure that fhem only runs once
|
||||||
|
if($ret && !$init_done) {
|
||||||
|
Log 1, "$ret. Exiting.";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
@ -94,7 +102,7 @@ telnet_Read($)
|
|||||||
}
|
}
|
||||||
if(ord($buf) == 4) { # EOT / ^D
|
if(ord($buf) == 4) { # EOT / ^D
|
||||||
CommandQuit($hash, "");
|
CommandQuit($hash, "");
|
||||||
next;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$buf =~ s/\r//g;
|
$buf =~ s/\r//g;
|
||||||
|
Loading…
Reference in New Issue
Block a user