/** * uptime.C: This file contains code for OS UPTIME * * 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 Patrick Fish, et al. * Rights to this code are as documented in doc/pod/license.pod. * * $Id: uptime.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $ */ #include "atheme.h" #include #include #include "servers.h" #include static char const rcsid[] = "$Id: uptime.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $"; REGISTER_MODULE ("operserv/uptime", false, "The Ermyth Team "); static void os_cmd_uptime (sourceinfo_t *si, int parc, char *parv[]); command_t const os_uptime = { "UPTIME", N_("Shows services uptime and the number of registered nicks and channels."), PRIV_SERVER_AUSPEX, 1, os_cmd_uptime }; E cmdvec os_cmdtree; E helpvec os_helptree; bool _modinit (module *m) { os_cmdtree << os_uptime; help_addentry (os_helptree, "UPTIME", "help/operserv/uptime", NULL); return true; } void _moddeinit () { os_cmdtree >> os_uptime; help_delentry (os_helptree, "UPTIME"); } static void os_cmd_uptime (sourceinfo_t *si, int parc, char *parv[]) { logcommand (si, CMDLOG_GET, "UPTIME"); command_success_nodata (si, PACKAGE_NAME "-%s #%s", version, generation); command_success_nodata (si, _("Services have been up for %s"), timediff (NOW - me.start)); command_success_nodata (si, _("Registered accounts: %d"), cnt.myuser); if (!nicksvs.no_nick_ownership) command_success_nodata (si, _("Registered nicknames: %d"), cnt.mynick); command_success_nodata (si, _("Registered channels: %d"), cnt.mychan); command_success_nodata (si, _("Users currently online: %d"), cnt.user - me.me->users); } /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs * vim:ts=8 * vim:sw=8 * vim:noexpandtab */