Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions modules/m_rehash.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,43 +86,38 @@ rehash_dns(struct Client *source_p)
static void
rehash_ssld(struct Client *source_p)
{
if (!IsOperAdmin(source_p)) {
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "admin");
return;
}
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is restarting ssld",
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"%s is restarting ssld",
get_oper_name(source_p));
if (!MyConnect(source_p))
remote_rehash_oper_p = source_p;

restart_ssld();
}

static void
rehash_motd(struct Client *source_p)
{
struct stat sb;
struct tm *local_tm;

sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"%s is forcing re-reading of MOTD file",
get_oper_name(source_p));
if (!MyConnect(source_p))
remote_rehash_oper_p = source_p;

free_cachefile(user_motd);
user_motd = cache_file(MPATH, "ircd.motd", 0);
if(stat(MPATH, &sb) == 0) {
local_tm = localtime(&sb.st_mtime);
if(local_tm != NULL) {
rb_snprintf(user_motd_changed, sizeof(user_motd_changed),
"%d/%d/%d %d:%d",
local_tm->tm_mday, local_tm->tm_mon + 1,
1900 + local_tm->tm_year, local_tm->tm_hour,
local_tm->tm_min);
}
}
cache_user_motd();
}

static void
rehash_rules(struct Client *source_p)
{
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"%s is forcing re-reading of RULES file",
get_oper_name(source_p));
if (!MyConnect(source_p))
remote_rehash_oper_p = source_p;

free_cachefile(user_rules);
user_rules = cache_file(RPATH, "ircd.rules", 0);
}

static void
Expand Down