ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/m_restart.c
(Generate patch)

Comparing ircd-hybrid-7.2/modules/m_restart.c (file contents):
Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 588 by michael, Mon May 8 13:22:59 2006 UTC

# Line 32 | Line 32
32   #include "numeric.h"
33   #include "s_conf.h"
34   #include "restart.h"
35 #include "s_log.h"
35   #include "send.h"
36   #include "msg.h"
37   #include "parse.h"
# Line 42 | Line 41 | static void mo_restart(struct Client *,
41  
42   struct Message restart_msgtab = {
43    "RESTART", 0, 0, 0, 0, MFLG_SLOW, 0,
44 <  {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_restart, m_ignore}
44 >  { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_restart, m_ignore }
45   };
46  
47   #ifndef STATIC_MODULES
# Line 70 | Line 69 | mo_restart(struct Client *client_p, stru
69             int parc, char *parv[])
70   {
71    char buf[IRCD_BUFSIZE];
73  dlink_node *ptr = NULL;
74  struct Client *target_p = NULL;
72  
73    if (!IsOperDie(source_p))
74    {
# Line 80 | Line 77 | mo_restart(struct Client *client_p, stru
77      return;
78    }
79  
80 <  if (parc < 2)
80 >  if (EmptyString(parv[1]))
81    {
82      sendto_one(source_p, ":%s NOTICE %s :Need server name /restart %s",
83                 me.name, source_p->name, me.name);
84      return;
85    }
89  else
90  {
91    if (irccmp(parv[1], me.name))
92    {
93      sendto_one(source_p, ":%s NOTICE %s :Mismatch on /restart %s",
94                 me.name, source_p->name, me.name);
95      return;
96    }
97  }
98
99  DLINK_FOREACH(ptr, local_client_list.head)
100  {
101    target_p = ptr->data;
102
103    sendto_one(target_p, ":%s NOTICE %s :Server Restarting. %s",
104               me.name, target_p->name, get_client_name(source_p, HIDE_IP));
105  }
86  
87 <  DLINK_FOREACH(ptr, serv_list.head)
87 >  if (irccmp(parv[1], me.name))
88    {
89 <    target_p = ptr->data;
90 <
91 <    sendto_one(target_p, ":%s ERROR :Restart by %s",
112 <               me.name, get_client_name(source_p, HIDE_IP));
89 >    sendto_one(source_p, ":%s NOTICE %s :Mismatch on /restart %s",
90 >               me.name, source_p->name, me.name);
91 >    return;
92    }
93  
94 <  ircsprintf(buf, "Server RESTART by %s",
95 <             get_client_name(source_p, HIDE_IP));
96 <  restart(buf);
94 >  ircsprintf(buf, "received RESTART command from %s",
95 >             get_oper_name(source_p));
96 >  server_die(buf, YES);
97   }
119

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines