try to read nick, user, host and realname so these can be configured
This commit is contained in:
parent
294458e6be
commit
3497661394
3 changed files with 31 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
||||||
Open Proxy Scanning Bot Module for NeoStats Changelog.
|
Open Proxy Scanning Bot Module for NeoStats Changelog.
|
||||||
==============================================================================
|
==============================================================================
|
||||||
* Version 2.2 * 24/01/2004 * Mark (M)
|
* Version 2.2 * 24/01/2004 * Mark (M)
|
||||||
- Fixed init_bot code - now uses services_bot_modes not hard coded ones
|
- Fixed init_bot code - now uses services_bot_modes not hard coded ones (M)
|
||||||
|
- We now try to read nick, user, host and realname so these can be configured more
|
||||||
|
easily (M)
|
||||||
|
|
||||||
* Version 2.1 * 24/01/2004 * Fish (F)
|
* Version 2.1 * 24/01/2004 * Fish (F)
|
||||||
- Sync up libopm with blitzed version to fix a Socks 5 bug (F)
|
- Sync up libopm with blitzed version to fix a Socks 5 bug (F)
|
||||||
|
|
26
opsb.c
26
opsb.c
|
@ -685,7 +685,7 @@ static int Online(char **av, int ac) {
|
||||||
|
|
||||||
SET_SEGV_LOCATION();
|
SET_SEGV_LOCATION();
|
||||||
|
|
||||||
if (init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", services_bot_modes, __module_info.module_name) == -1 ) {
|
if (init_bot(s_opsb, opsb.user, opsb.host, opsb.rname, services_bot_modes, __module_info.module_name) == -1 ) {
|
||||||
/* Nick was in use!!!! */
|
/* Nick was in use!!!! */
|
||||||
strlcat(s_opsb, "_", MAXNICK);
|
strlcat(s_opsb, "_", MAXNICK);
|
||||||
init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", services_bot_modes, __module_info.module_name);
|
init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", services_bot_modes, __module_info.module_name);
|
||||||
|
@ -1170,6 +1170,30 @@ void LoadConfig(void)
|
||||||
char datapath[512];
|
char datapath[512];
|
||||||
exemptinfo *exempts;
|
exemptinfo *exempts;
|
||||||
|
|
||||||
|
if (GetConf((void *) &tmp, CFGSTR, "Nick") < 0) {
|
||||||
|
strlcpy(s_opsb, "opsb", MAXNICK);
|
||||||
|
} else {
|
||||||
|
strlcpy(s_opsb, tmp, MAXNICK);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
if (GetConf((void *) &tmp, CFGSTR, "User") < 0) {
|
||||||
|
strlcpy(opsb.user, "opsb", MAXUSER);
|
||||||
|
} else {
|
||||||
|
strlcpy(opsb.user, tmp, MAXUSER);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
if (GetConf((void *) &tmp, CFGSTR, "Host") < 0) {
|
||||||
|
strlcpy(opsb.host, me.name, MAXHOST);
|
||||||
|
} else {
|
||||||
|
strlcpy(opsb.host, tmp, MAXHOST);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
if (GetConf((void *) &tmp, CFGSTR, "Rname") < 0) {
|
||||||
|
ircsnprintf(opsb.rname, MAXREALNAME, "Proxy Scanning Bot");
|
||||||
|
} else {
|
||||||
|
strlcpy(opsb.rname, tmp, MAXREALNAME);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
if (GetConf((void *)&tmp, CFGSTR, "OpmDomain") <= 0) {
|
if (GetConf((void *)&tmp, CFGSTR, "OpmDomain") <= 0) {
|
||||||
strlcpy(opsb.opmdomain, "opm.blitzed.org", MAXHOST);
|
strlcpy(opsb.opmdomain, "opm.blitzed.org", MAXHOST);
|
||||||
} else {
|
} else {
|
||||||
|
|
3
opsb.h
3
opsb.h
|
@ -53,6 +53,9 @@ struct scanq {
|
||||||
typedef struct scanq scaninfo;
|
typedef struct scanq scaninfo;
|
||||||
|
|
||||||
struct opsb {
|
struct opsb {
|
||||||
|
char user[MAXUSER];
|
||||||
|
char host[MAXHOST];
|
||||||
|
char rname[MAXREALNAME];
|
||||||
char opmdomain[MAXHOST];
|
char opmdomain[MAXHOST];
|
||||||
int init;
|
int init;
|
||||||
char targethost[MAXHOST];
|
char targethost[MAXHOST];
|
||||||
|
|
Reference in a new issue