ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/modules/operserv/shutdown.C
Revision: 1.7
Committed: Sat Sep 22 14:27:28 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +3 -3 lines
Log Message:
split up ermyth into ermyth-modules, libermyth (currently just ermyth-util) and ermyth-core

File Contents

# Content
1 /**
2 * shutdown.C: This file contains functionality which implements the OperServ SHUTDOWN command.
3 *
4 * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5 * Rights to this code are as documented in COPYING.
6 *
7 *
8 * Portions of this file were derived from sources bearing the following license:
9 * Copyright © 2005-2006 Atheme Development Group
10 * Rights to this code are documented in doc/pod/license.pod.
11 *
12 * $Id: shutdown.C,v 1.6 2007-09-16 18:54:44 pippijn Exp $
13 */
14
15 #include "atheme.h"
16 #include <ermyth/module.h>
17 #include <ermyth/database.h>
18
19 static char const rcsid[] = "$Id: shutdown.C,v 1.6 2007-09-16 18:54:44 pippijn Exp $";
20
21 REGISTER_MODULE ("operserv/shutdown", false, "The Ermyth Team <http://ermyth.xinutec.org>");
22
23 static void os_cmd_shutdown (sourceinfo_t *si, int parc, char *parv[]);
24
25 command_t const os_shutdown = { "SHUTDOWN", N_("Shuts down services."), PRIV_ADMIN, 0, os_cmd_shutdown };
26
27 E cmdvec os_cmdtree;
28 E helpvec os_helptree;
29
30 bool
31 _modinit (module *m)
32 {
33 os_cmdtree << os_shutdown;
34 help_addentry (os_helptree, "SHUTDOWN", "help/operserv/shutdown", NULL);
35
36 return true;
37 }
38
39 void
40 _moddeinit ()
41 {
42 os_cmdtree >> os_shutdown;
43 help_delentry (os_helptree, "SHUTDOWN");
44 }
45
46 static void
47 os_cmd_shutdown (sourceinfo_t *si, int parc, char *parv[])
48 {
49 snoop ("UPDATE: \2%s\2", get_oper_name (si));
50 wallops ("Updating database by request of \2%s\2.", get_oper_name (si));
51 expire_check (NULL);
52 backend->save ();
53
54 logcommand (si, CMDLOG_ADMIN, "SHUTDOWN");
55 snoop ("SHUTDOWN: \2%s\2", get_oper_name (si));
56 wallops ("Shutting down by request of \2%s\2.", get_oper_name (si));
57
58 runflags |= RF_SHUTDOWN;
59 }
60
61 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
62 * vim:ts=8
63 * vim:sw=8
64 * vim:noexpandtab
65 */