aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_hack.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-08-10 08:39:27 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-08-10 08:39:27 +0200
commitd5d1cef7c26a830c056b5f6b1611497252ec521f (patch)
tree21176106fffdbe4b5d34f48ff5c0a6d2d8425905 /openbsc/src/bsc_hack.c
parent850326e377f59211dfc03ab1d4623a896b987143 (diff)
bsc_hack.c: Allow to use a different file for the config file
Diffstat (limited to 'openbsc/src/bsc_hack.c')
-rw-r--r--openbsc/src/bsc_hack.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 56684cc31..02de54217 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -60,6 +60,7 @@ static int cardnr = 0;
static int release_l2 = 0;
static enum gsm_bts_type BTS_TYPE = GSM_BTS_TYPE_BS11;
static const char *database_name = "hlr.sqlite3";
+static const char *config_file = "openbsc.cfg";
extern int ipacc_rtp_direct;
@@ -1067,7 +1068,7 @@ static int bootstrap_network(void)
printf("DB: Database prepared.\n");
telnet_init(gsmnet, 4242);
- rc = vty_read_config_file("openbsc.cfg");
+ rc = vty_read_config_file(config_file);
if (rc < 0)
return rc;
@@ -1111,6 +1112,7 @@ static void print_help()
printf(" -h --help this text\n");
printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging\n");
printf(" -s --disable-color\n");
+ printf(" -c --config-file filename The config file to use.\n");
printf(" -l --database db-name The database to use\n");
printf(" -a --authorize-everyone Allow everyone into the network.\n");
printf(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
@@ -1126,6 +1128,7 @@ static void handle_options(int argc, char** argv)
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"debug", 1, 0, 'd'},
+ {"config-file", 1, 0, 'c'},
{"disable-color", 0, 0, 's'},
{"database", 1, 0, 'l'},
{"authorize-everyone", 0, 0, 'a'},
@@ -1138,7 +1141,7 @@ static void handle_options(int argc, char** argv)
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hd:sl:ar:p:C:RTP",
+ c = getopt_long(argc, argv, "hd:sl:ar:p:C:RTPc:",
long_options, &option_index);
if (c == -1)
break;
@@ -1157,6 +1160,9 @@ static void handle_options(int argc, char** argv)
case 'l':
database_name = strdup(optarg);
break;
+ case 'c':
+ config_file = strdup(optarg);
+ break;
case 'a':
gsm0408_allow_everyone(1);
break;