Shutdown if there are no more IRC connections.

This commit is contained in:
Elijah Perrault committed 2011-02-15 13:58:21 -07:00
1 parent e543af08ad
commit 7f6cd84af8
2 files changed
+11

No files matched your search

+10
View File
@@ -476,6 +476,16 @@ while (1) {
err(2, "Lost connection to $sockid!", 0);
$SELECT->remove($sock);
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;
}
+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
===============================================================================
* Shutdown if there are no more IRC connections.
* Added the ability to use printf(3) % variables in trans().
* Added slog() to API::Log for logging to IRC.
* Added a Greet module for greeting users on join.