summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2025-08-09 11:14:06 +0100
committerLuke Bratch <luke@bratch.co.uk>2025-08-09 11:14:06 +0100
commit1d41511b7ffb607137308adabd6b2d06906d4023 (patch)
tree74c1be01b3d572a91fb14fc6936d6bfb7b3bcb60
parentfe6ac12dbe4a91cd8652421aaaae18fed23cc6e6 (diff)
Add quit to STDIN commands.
-rw-r--r--README1
-rw-r--r--blabouncer.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index dec0475..e3e5c7b 100644
--- a/README
+++ b/README
@@ -117,3 +117,4 @@ If run in foreground mode, the following commands can be sent to standard input:
"listchannels" (To list all joined channels and their members.)
"reopenssl" (To reload the client-side TLS certificate/key.)
"listclients" (To list all connected clients and their authentication status.)
+"quit" (To quit blabouncer.)
diff --git a/blabouncer.c b/blabouncer.c
index f4b084e..2e569a1 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -842,6 +842,19 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) {
continue;
}
+ // STDIN: Quit blabouncer
+ if (strncmp(outgoingmsg, "quit", strlen("quit")) == 0) {
+ printf("STDIN command starting: quit\n");
+ debugprint(DEBUG_SOME, "dochat(): stdin: STDIN command starting: quit\n");
+
+ cleanexit(server_ssl, clients, 0, &ircdstate, settings, "");
+
+ debugprint(DEBUG_SOME, "dochat(): stdin: STDIN command complete: quit\n");
+ printf("STDIN command complete: quit\n");
+
+ continue;
+ }
+
debugprint(DEBUG_FULL, "dochat(): stdin: '%s' not processed as a command, sending to server.\n", outgoingmsg);
printf("'%s' not processed as a command, sending to server.\n", outgoingmsg);
// sourcefd = 0 as this is a trusted message