- Timestamp:
- 2006-01-20T15:15:49Z (18 years ago)
- Branches:
- master
- Children:
- 54879ab, f1d38f2
- Parents:
- 55ec2d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ipc.c
r55ec2d6 rf73b969 32 32 33 33 34 static intipc_master_cmd_client( irc_t *data, char **cmd )34 static void ipc_master_cmd_client( irc_t *data, char **cmd ) 35 35 { 36 36 struct bitlbee_child *child = (void*) data; … … 45 45 ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n", 46 46 child ? child->pid : -1, cmd[2], cmd[1], cmd[3] ); 47 48 return 1; 49 } 50 51 static int ipc_master_cmd_die( irc_t *data, char **cmd ) 47 } 48 49 static void ipc_master_cmd_die( irc_t *data, char **cmd ) 52 50 { 53 51 if( global.conf->runmode == RUNMODE_FORKDAEMON ) … … 55 53 56 54 bitlbee_shutdown( NULL ); 57 58 return 1; 59 } 60 61 int ipc_master_cmd_rehash( irc_t *data, char **cmd ) 55 } 56 57 void ipc_master_cmd_rehash( irc_t *data, char **cmd ) 62 58 { 63 59 runmode_t oldmode; … … 76 72 if( global.conf->runmode == RUNMODE_FORKDAEMON ) 77 73 ipc_to_children( cmd ); 78 79 return 1;80 74 } 81 75 … … 92 86 93 87 94 static int ipc_child_cmd_die( irc_t *irc, char **cmd ) 95 { 96 if( irc->status >= USTATUS_LOGGED_IN ) 97 irc_write( irc, "ERROR :Operator requested server shutdown, bye bye!" ); 98 99 irc_abort( irc ); 100 101 return 1; 102 } 103 104 static int ipc_child_cmd_wallops( irc_t *irc, char **cmd ) 88 static void ipc_child_cmd_die( irc_t *irc, char **cmd ) 89 { 90 irc_abort( irc, 1, "Shutdown requested by operator" ); 91 } 92 93 static void ipc_child_cmd_wallops( irc_t *irc, char **cmd ) 105 94 { 106 95 if( irc->status < USTATUS_LOGGED_IN ) 107 return 1;96 return; 108 97 109 98 if( strchr( irc->umode, 'w' ) ) 110 99 irc_write( irc, ":%s WALLOPS :%s", irc->myhost, cmd[1] ); 111 112 return 1; 113 } 114 115 static int ipc_child_cmd_lilo( irc_t *irc, char **cmd ) 100 } 101 102 static void ipc_child_cmd_lilo( irc_t *irc, char **cmd ) 116 103 { 117 104 if( irc->status < USTATUS_LOGGED_IN ) 118 return 1;105 return; 119 106 120 107 if( strchr( irc->umode, 's' ) ) 121 108 irc_write( irc, ":%s NOTICE %s :%s", irc->myhost, irc->nick, cmd[1] ); 122 123 return 1; 124 } 125 126 static int ipc_child_cmd_opermsg( irc_t *irc, char **cmd ) 109 } 110 111 static void ipc_child_cmd_opermsg( irc_t *irc, char **cmd ) 127 112 { 128 113 if( irc->status < USTATUS_LOGGED_IN ) 129 return 1;114 return; 130 115 131 116 if( strchr( irc->umode, 'o' ) ) 132 117 irc_write( irc, ":%s NOTICE %s :*** OperMsg *** %s", irc->myhost, irc->nick, cmd[1] ); 133 134 return 1; 135 } 136 137 static int ipc_child_cmd_rehash( irc_t *irc, char **cmd ) 118 } 119 120 static void ipc_child_cmd_rehash( irc_t *irc, char **cmd ) 138 121 { 139 122 runmode_t oldmode; … … 145 128 146 129 global.conf->runmode = oldmode; 147 148 return 1; 149 } 150 151 static int ipc_child_cmd_kill( irc_t *irc, char **cmd ) 130 } 131 132 static void ipc_child_cmd_kill( irc_t *irc, char **cmd ) 152 133 { 153 134 if( irc->status < USTATUS_LOGGED_IN ) 154 return 1;135 return; 155 136 156 137 if( nick_cmp( cmd[1], irc->nick ) != 0 ) 157 return 1;/* It's not for us. */138 return; /* It's not for us. */ 158 139 159 140 irc_write( irc, ":%s!%s@%s KILL %s :%s", irc->mynick, irc->mynick, irc->myhost, irc->nick, cmd[2] ); 160 irc_abort( irc ); 161 /* g_io_channel_close( irc->io_channel ); */ 162 163 return 0; 141 irc_abort( irc, 0, "Killed by operator: %s", cmd[2] ); 164 142 } 165 143
Note: See TracChangeset
for help on using the changeset viewer.