mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-29 05:30:14 +00:00
allow you to specify -htdocs dir at runtime.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11614 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b4761bdaf3
commit
44a729e38e
17
src/switch.c
17
src/switch.c
@ -303,6 +303,7 @@ int main(int argc, char *argv[])
|
|||||||
"\t-log [logdir] -- specify an alternate log dir\n"
|
"\t-log [logdir] -- specify an alternate log dir\n"
|
||||||
"\t-db [dbdir] -- specify an alternate db dir\n"
|
"\t-db [dbdir] -- specify an alternate db dir\n"
|
||||||
"\t-mod [moddir] -- specify an alternate mod dir\n"
|
"\t-mod [moddir] -- specify an alternate mod dir\n"
|
||||||
|
"\t-htdocs [htdocsdir] -- specify an alternate htdocs dir\n"
|
||||||
"\t-scripts [scriptsdir] -- specify an alternate scripts dir\n";
|
"\t-scripts [scriptsdir] -- specify an alternate scripts dir\n";
|
||||||
|
|
||||||
for (x = 1; x < argc; x++) {
|
for (x = 1; x < argc; x++) {
|
||||||
@ -550,6 +551,22 @@ int main(int argc, char *argv[])
|
|||||||
known_opt++;
|
known_opt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argv[x] && !strcmp(argv[x], "-htdocs")) {
|
||||||
|
x++;
|
||||||
|
if (argv[x] && strlen(argv[x])) {
|
||||||
|
SWITCH_GLOBAL_dirs.htdocs_dir = (char *) malloc(strlen(argv[x]) + 1);
|
||||||
|
if (!SWITCH_GLOBAL_dirs.htdocs_dir) {
|
||||||
|
fprintf(stderr, "Allocation error\n");
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
strcpy(SWITCH_GLOBAL_dirs.htdocs_dir, argv[x]);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "When using -htdocs you must specify a htdocs directory\n");
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
known_opt++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!known_opt || (argv[x] && (!strcmp(argv[x], "-help") || !strcmp(argv[x], "-h") || !strcmp(argv[x], "-?")))) {
|
if (!known_opt || (argv[x] && (!strcmp(argv[x], "-help") || !strcmp(argv[x], "-h") || !strcmp(argv[x], "-?")))) {
|
||||||
printf("%s\n", usageDesc);
|
printf("%s\n", usageDesc);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user