Shutdown if there are no more IRC connections.
This commit is contained in:
1 parent
e543af08ad
commit
7f6cd84af8
2 files changed
+11
No files matched your search
@@ -476,6 +476,16 @@ while (1) {
|
|||||||
err(2, "Lost connection to $sockid!", 0);
|
err(2, "Lost connection to $sockid!", 0);
|
||||||
$SELECT->remove($sock);
|
$SELECT->remove($sock);
|
||||||
delete $SOCKET{$sockid};
|
delete $SOCKET{$sockid};
|
||||||
|
if (!keys %SOCKET) {
|
||||||
|
# No more connections, stop the program.
|
||||||
|
$Auto::DB->disconnect;
|
||||||
|
API::Std::event_run('on_shutdown');
|
||||||
|
if (-e "$Bin/auto.pid") { unlink "$Bin/auto.pid"; }
|
||||||
|
dbug '* No more IRC connections, shutting down.';
|
||||||
|
alog '* No more IRC connections, shutting down.';
|
||||||
|
sleep 1;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
* Shutdown if there are no more IRC connections.
|
||||||
* Added the ability to use printf(3) % variables in trans().
|
* Added the ability to use printf(3) % variables in trans().
|
||||||
* Added slog() to API::Log for logging to IRC.
|
* Added slog() to API::Log for logging to IRC.
|
||||||
* Added a Greet module for greeting users on join.
|
* Added a Greet module for greeting users on join.
|
||||||
|
|||||||
Reference in new issue
Block a user