1 Author: Michael Tremer <michael.tremer@ipfire.org>
3 diff -Nur ibod-1.4/ibod.c ibod-1.4-conf/ibod.c
4 --- ibod-1.4/ibod.c 2000-04-11 05:34:17.000000000 +0000
5 +++ ibod-1.4-conf/ibod.c 2011-11-11 18:50:45.510054466 +0000
7 static void get_if_state();
8 static int bring_up_slave();
9 static int bring_down_slave();
11 +static char *config_file;
13 static struct timeval timeout, tv_last, tv_up;
14 static int usageflags[ISDN_MAX_CHANNELS];
20 /* Find out where to look for configuration file */
21 - if ((home = getenv("IBOD_HOME")) == NULL)
22 - home = IBOD_DEFAULT_DIR;
24 + config_file = argv[1];
26 + config_file = IBOD_DEFAULT_CONF;
29 /* Setup initial attributes */
30 - if (setattr(home) == -1) {
31 + if (setattr(config_file) == -1) {
39 -static int setattr(char *home)
40 +static int setattr(char *config_filename)
43 - char config_filename[MAX_STR_LEN];
44 char linebuf[MAX_STR_LEN];
48 cf.stayup_time = STAYUP_TIME;
50 /* Open config file */
51 - sprintf(config_filename, "%s/ibod.cf", home);
52 if ((fd = fopen(config_filename, "r")) == NULL) {
53 syslog(LOG_ERR, "%s: %s\n", config_filename, strerror(errno));
57 static void reread(int sig)
59 - (void) setattr(home);
60 + (void) setattr(config_file);
64 diff -Nur ibod-1.4/ibod.h ibod-1.4-conf/ibod.h
65 --- ibod-1.4/ibod.h 2011-11-11 19:00:45.623454321 +0000
66 +++ ibod-1.4-conf/ibod.h 2011-11-11 18:45:39.703353901 +0000
68 #define STAYUP_TIME 30
70 #define IBOD_DEFAULT_DIR "/etc/isdn"
71 +#define IBOD_DEFAULT_CONF IBOD_DEFAULT_DIR "/ibod.cf"
72 #define MAX_STR_LEN 512
73 #define ISDN_INFO_DEV "/dev/isdninfo"
74 #define ISDN_CTLR_DEV "/dev/isdnctrl"