From ef7f7ce45219328e044479101aae732ac3979521 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 19 Apr 2009 06:35:12 +0000 Subject: [PATCH] [bsc_hack] Initialize db as part of the network Let us establish the rule that there is one DB per network. This will allow to assign a BTS of the network to a subscriber that is loaded from the db across restarts. --- src/bsc_hack.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bsc_hack.c b/src/bsc_hack.c index ac109f1fe..3fbc7f645 100644 --- a/src/bsc_hack.c +++ b/src/bsc_hack.c @@ -916,6 +916,18 @@ static int bootstrap_network(void) paging_init(bts); bts->paging.channel_allocated = bsc_hack_channel_allocated; + if (db_init(database_name)) { + printf("DB: Failed to init database. Please check the option settings.\n"); + return -1; + } + printf("DB: Database initialized.\n"); + + if (db_prepare()) { + printf("DB: Failed to prepare database.\n"); + return -1; + } + printf("DB: Database prepared.\n"); + telnet_init(gsmnet, 4242); /* E1 mISDN input setup */ @@ -1046,18 +1058,6 @@ int main(int argc, char **argv) /* parse options */ handle_options(argc, argv); - if (db_init(database_name)) { - printf("DB: Failed to init database. Please check the option settings.\n"); - return 1; - } - printf("DB: Database initialized.\n"); - - if (db_prepare()) { - printf("DB: Failed to prepare database.\n"); - return 1; - } - printf("DB: Database prepared.\n"); - /* seed the PRNG */ srand(time(NULL));