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);
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user