mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2061 from juhovan/issue-2060
Fixed irc bot reconnect if socket dies
This commit is contained in:
5
irc.php
5
irc.php
@ -74,7 +74,6 @@ class ircbot {
|
||||
$this->sql = $database_link;
|
||||
}
|
||||
|
||||
$this->j = 2;
|
||||
$this->config = $config;
|
||||
$this->debug = $this->config['irc_debug'];
|
||||
$this->config['irc_authtime'] = $this->config['irc_authtime'] ? $this->config['irc_authtime'] : 3;
|
||||
@ -150,6 +149,8 @@ class ircbot {
|
||||
$this->connect_alert();
|
||||
}
|
||||
|
||||
$this->j = 2;
|
||||
|
||||
$this->connect();
|
||||
$this->log('Connected');
|
||||
if ($this->pass) {
|
||||
@ -159,7 +160,7 @@ class ircbot {
|
||||
$this->doAuth();
|
||||
while (true) {
|
||||
foreach ($this->socket as $n => $socket) {
|
||||
if (!is_resource($socket)) {
|
||||
if (!is_resource($socket) || feof($socket)) {
|
||||
$this->log("Socket '$n' closed. Restarting.");
|
||||
break 2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user