/** * rehash.C: This file contains functionality which implements the OperServ REHASH command. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005-2006 Atheme Development Group * Rights to this code are documented in doc/pod/license.pod. * * $Id: rehash.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $ */ #include "atheme.h" #include #include static char const rcsid[] = "$Id: rehash.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $"; REGISTER_MODULE ("operserv/rehash", false, "The Ermyth Team "); static void os_cmd_rehash (sourceinfo_t *si, int parc, char *parv[]); command_t const os_rehash = { "REHASH", N_("Reload the configuration data."), PRIV_ADMIN, 0, os_cmd_rehash }; E cmdvec os_cmdtree; E helpvec os_helptree; bool _modinit (module *m) { os_cmdtree << os_rehash; help_addentry (os_helptree, "REHASH", "help/operserv/rehash", NULL); return true; } void _moddeinit () { os_cmdtree >> os_rehash; help_delentry (os_helptree, "REHASH"); } /* REHASH */ void os_cmd_rehash (sourceinfo_t *si, int parc, char *parv[]) { snoop ("UPDATE: \2%s\2", get_oper_name (si)); wallops ("Updating database by request of \2%s\2.", get_oper_name (si)); expire_check (NULL); backend->save (); snoop ("REHASH: \2%s\2", get_oper_name (si)); logcommand (si, CMDLOG_ADMIN, "REHASH"); wallops ("Rehashing \2%s\2 by request of \2%s\2.", config_file, get_oper_name (si)); if (conf_rehash ()) command_success_nodata (si, _("REHASH completed.")); else command_fail (si, fault::nosuch_target, _("REHASH of \2%s\2 failed. Please corrrect any errors in the file and try again."), config_file); }