diff -ur bitlbee-1.0/account.c bitlbee-1.0.new/account.c
old
|
new
|
|
154 | 154 | cancel_auto_reconnect( a ); |
155 | 155 | } |
156 | 156 | } |
| 157 | |
| 158 | void reconnect_all_accounts( void ) |
| 159 | { |
| 160 | irc_t *irc; |
| 161 | account_t *account; |
| 162 | GSList *ircconn; |
| 163 | |
| 164 | for ( ircconn = irc_connection_list; ircconn; |
| 165 | ircconn = ircconn->next ) { |
| 166 | irc = ircconn->data; |
| 167 | if ( !set_getint( irc, "auto_reconnect" ) ) |
| 168 | continue; |
| 169 | |
| 170 | irc_usermsg( irc, "Reconnecting active accounts..." ); |
| 171 | |
| 172 | for ( account = irc->accounts; account; |
| 173 | account = account->next ) { |
| 174 | if ( account->gc ) |
| 175 | signoff( account-> gc ); |
| 176 | } |
| 177 | } |
| 178 | } |
diff -ur bitlbee-1.0/account.h bitlbee-1.0.new/account.h
old
|
new
|
|
45 | 45 | void account_del( irc_t *irc, account_t *acc ); |
46 | 46 | void account_on( irc_t *irc, account_t *a ); |
47 | 47 | void account_off( irc_t *irc, account_t *a ); |
| 48 | void reconnect_all_accounts( void ); |
48 | 49 | |
49 | 50 | #endif |
diff -ur bitlbee-1.0/doc/bitlbee.8 bitlbee-1.0.new/doc/bitlbee.8
old
|
new
|
|
86 | 86 | .SH COMMANDS |
87 | 87 | To get a complete list of commands, please use the \fBhelp commands\fP |
88 | 88 | command in the &bitlbee channel. |
| 89 | .SH SIGNALS |
| 90 | .IP SIGTERM |
| 91 | Sending \fBSIGTERM\fP twice causes bitlbee to exit. |
| 92 | .IP SIGUSR1 |
| 93 | Upon receiving \fBSIGUSR1\fP, bitlbee reconnects all active accounts on |
| 94 | all connected clients. |
89 | 95 | .SH "SEE ALSO" |
90 | 96 | .BR ircd (8), |
91 | 97 | .BR inetd (8), |
diff -ur bitlbee-1.0/unix.c bitlbee-1.0.new/unix.c
old
|
new
|
|
74 | 74 | memset( &sig, 0, sizeof( sig ) ); |
75 | 75 | sig.sa_handler = sighandler; |
76 | 76 | sigaction( SIGPIPE, &sig, &old ); |
| 77 | sigaction( SIGUSR1, &sig, &old ); |
77 | 78 | sig.sa_flags = SA_RESETHAND; |
78 | 79 | sigaction( SIGINT, &sig, &old ); |
79 | 80 | sigaction( SIGILL, &sig, &old ); |
… |
… |
|
126 | 127 | raise( signal ); |
127 | 128 | } |
128 | 129 | } |
| 130 | else if( signal == SIGUSR1) |
| 131 | { |
| 132 | reconnect_all_accounts(); |
| 133 | } |
129 | 134 | else if( signal != SIGPIPE ) |
130 | 135 | { |
131 | 136 | log_message( LOGLVL_ERROR, "Fatal signal received: %d. That's probably a bug.", signal ); |