Debian Codegraph @

modules/operserv/shutdown.c

raw
1 /*
2 * Copyright (c) 2005-2006 Atheme Development Group
3 * Rights to this code are documented in doc/LICENSE.
4 *
5 * This file contains functionality which implements the OService SHUTDOWN command.
6 *
7 */
8
9 #include "atheme.h"
10
11 DECLARE_MODULE_V1
12 (
13 "operserv/shutdown", false, _modinit, _moddeinit,
14 PACKAGE_STRING,
15 VENDOR_STRING
16 );
17
18 static void os_cmd_shutdown(sourceinfo_t *si, int parc, char *parv[]);
19
20 command_t os_shutdown = { "SHUTDOWN", N_("Shuts down services."), PRIV_ADMIN, 0, os_cmd_shutdown, { .path = "oservice/shutdown" } };
21
22 void _modinit(module_t *m)
23 {
24 service_named_bind_command("operserv", &os_shutdown);
25 }
26
27 void _moddeinit(module_unload_intent_t intent)
28 {
29 service_named_unbind_command("operserv", &os_shutdown);
30 }
31
32 static void os_cmd_shutdown(sourceinfo_t *si, int parc, char *parv[])
33 {
34 logcommand(si, CMDLOG_ADMIN, "SHUTDOWN");
35 wallops("Shutting down by request of \2%s\2.", get_oper_name(si));
36
37 runflags |= RF_SHUTDOWN;
38 }
39
40 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
41 * vim:ts=8
42 * vim:sw=8
43 * vim:noexpandtab
44 */