added per-override run feature

master
Evgeniy Kozhuhovskiy 19 years ago
parent e55de5023e
commit 40556b610a

@ -47,3 +47,6 @@
0.22.9 0.22.9
====== ======
+ Changed version for compliance with *BSD ports + Changed version for compliance with *BSD ports
+ Added possibility to run external program for each override and
hidden. See bforce.subst.sample for examples and
docs/readme.txt for details

@ -2,7 +2,6 @@
"+" - feature "+" - feature
+ per link dial_prefix option
- sed detection in makefile - sed detection in makefile
+ [io_modem.c] add random and smart algorythms selecting of tty. + [io_modem.c] add random and smart algorythms selecting of tty.
smart means (1) write time stat for every line and (2) evenly smart means (1) write time stat for every line and (2) evenly

@ -151,3 +151,12 @@ Escape character is '^]'.
éÓËÒÅÎÎÅ ×ÁÛ... Igor Mitichev (2:6001/9.0) éÓËÒÅÎÎÅ ×ÁÛ... Igor Mitichev (2:6001/9.0)
3 ÍÁÑ 2005 Ç. 15:30 3 ÍÁÑ 2005 Ç. 15:30
Некоторые дополнения по-поводу новых фич
========================================
override .. hidden
С версии 0.22.9 bforce научился запускать внешнюю программу для
каждого линка/его хиддена. Для чего это сделано? Единственно, что
мне приходит в голову - необходимость залочить модем/послать в
него строку иницализации. Но возможно, вы придумаете совершенно
иное применение этой фиче.

@ -17,17 +17,18 @@
# Override 1:2/3 Phone Unpublished # Override 1:2/3 Phone Unpublished
# #
# Happy # Happy
override 776:308/1 Ipaddr 192.168.1.1 Flags CM,IFC #override 776:308/1 Ipaddr 192.168.1.1 Flags CM,IFC
override 776:308/1.1 Ipaddr 192.168.1.2 Flags CM,BINKP #override 776:308/1.1 Ipaddr 192.168.1.2 Flags CM,BINKP
# Estar # Estar
override 2:5020/758 Phone 961-2243 #override 2:5020/758 Phone 961-2243
# Hard Core # Hard Core
override 2:5020/1398 Phone 700-0245 Worktime 00:00-07:00 #override 2:5020/1398 Phone 700-0245 Worktime 00:00-07:00
# Stick's # Stick's
override 2:5020/1682 Phone 308-5537 Worktime 23:30-07:00 #override 2:5020/1682 Phone 308-5537 Worktime 23:30-07:00
#override 2:5020/2120 Ipaddr 192.168.1.1 flags BINKP,CM
override 2:5020/2120 Ipaddr 192.168.1.1 flags BINKP,CM
# Example how to run external script.
#override 2:4500/1 Phone 123-4567 run /usr/local/bin/sc45001.sh

@ -1,3 +1,8 @@
2005-10-24 Evgeniy Kozhuhovskiy <ugenk@mgts.by>
* bforce/sess_call.c (call_system): added possibility to run
external script for each line in override
2005-09-03 Andrey Slusar <anray@users.sourceforge.net> 2005-09-03 Andrey Slusar <anray@users.sourceforge.net>
* bforce/prot_emsi_misc.c (emsi_parsedat): correct time_t arg * bforce/prot_emsi_misc.c (emsi_parsedat): correct time_t arg

@ -375,6 +375,13 @@ static int proc_override(s_override *dest, char *value)
(*p)->sIpaddr = xstrcpy(arg); (*p)->sIpaddr = xstrcpy(arg);
key = NULL; key = NULL;
} }
else if( strcasecmp(key, "run") == 0)
{
if( (*p)->run )
free((*p)->run);
(*p)->run = xstrcpy(arg);
key = NULL;
}
else if( strcasecmp(key, "worktime") == 0 ) else if( strcasecmp(key, "worktime") == 0 )
{ {
if( timevec_parse_list(&((*p)->worktime), arg) == -1 ) if( timevec_parse_list(&((*p)->worktime), arg) == -1 )

@ -539,6 +539,7 @@ int call_system_tcpip(void)
int call_system(s_faddr addr, const s_bforce_opts *opts) int call_system(s_faddr addr, const s_bforce_opts *opts)
{ {
int rc = 0; int rc = 0;
int runrc = 0;
char abuf[BF_MAXADDRSTR+1]; char abuf[BF_MAXADDRSTR+1];
char *p_lockdir = NULL; char *p_lockdir = NULL;
char *errmsg = NULL; char *errmsg = NULL;
@ -668,6 +669,13 @@ do_session:
errmsg = "cannot lock address"; errmsg = "cannot lock address";
gotoexit(BFERR_SYSTEM_LOCKED); gotoexit(BFERR_SYSTEM_LOCKED);
} }
if( strlen(state.override.run) > 0 )
{
if ( (runrc = system(state.override.run) != 0 ))
{
logerr("run script \"%s\" executed with non-zero return value", state.override.run);
}
}
setproctitle("bforce calling %.32s, %.32s", setproctitle("bforce calling %.32s, %.32s",
ftn_addrstr(abuf, state.node.addr), state.node.phone); ftn_addrstr(abuf, state.node.addr), state.node.phone);

@ -142,6 +142,7 @@ typedef struct override {
char *sFlags; char *sFlags;
s_timevec worktime; s_timevec worktime;
s_timevec freqtime; s_timevec freqtime;
char *run;
struct override *hidden; /* Hidden lines list */ struct override *hidden; /* Hidden lines list */
} s_override; } s_override;

Loading…
Cancel
Save