From: Stefan Knoblich Date: Thu, 12 Jul 2012 17:52:00 +0000 (+0200) Subject: freeswitch: Add -base cmdline option. X-Git-Tag: v1.2.0~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d141de28eaa18882f8aba0a1b69d0e61430cd264;p=thirdparty%2Ffreeswitch.git freeswitch: Add -base cmdline option. Signed-off-by: Stefan Knoblich --- diff --git a/src/switch.c b/src/switch.c index 3fddcb4693..4f25701671 100644 --- a/src/switch.c +++ b/src/switch.c @@ -365,6 +365,7 @@ static const char usage[] = #endif "\t-c -- output to a console and stay in the foreground\n" "\n\tOptions to control locations of files:\n" + "\t-base [basedir] -- alternate prefix directory\n" "\t-conf [confdir] -- alternate directory for FreeSWITCH configuration files\n" "\t-log [logdir] -- alternate directory for logfiles\n" "\t-run [rundir] -- alternate directory for runtime files\n" @@ -766,6 +767,21 @@ int main(int argc, char *argv[]) strcpy(SWITCH_GLOBAL_dirs.htdocs_dir, local_argv[x]); } + else if (!strcmp(local_argv[x], "-base")) { + x++; + if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) { + fprintf(stderr, "When using -base you must specify a base directory\n"); + return 255; + } + + SWITCH_GLOBAL_dirs.base_dir = (char *) malloc(strlen(local_argv[x]) + 1); + if (!SWITCH_GLOBAL_dirs.base_dir) { + fprintf(stderr, "Allocation error\n"); + return 255; + } + strcpy(SWITCH_GLOBAL_dirs.base_dir, local_argv[x]); + } + else if (!strcmp(local_argv[x], "-temp")) { x++; if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) {