]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-198 (runtime select the mod dir)
authorMichael Jerris <mike@jerris.com>
Thu, 9 Oct 2008 16:05:35 +0000 (16:05 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 9 Oct 2008 16:05:35 +0000 (16:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9913 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch.c

index 736611ee403027fb7d4a9bc1c9111e889faac550..f96d70662fc3dabc5750283d61cc1a7b43194d36 100644 (file)
@@ -297,6 +297,7 @@ int main(int argc, char *argv[])
                "\t-conf [confdir]  -- specify an alternate config dir\n"
                "\t-log [logdir]    -- specify an alternate log dir\n"
                "\t-db [dbdir]      -- specify an alternate db dir\n"
+               "\t-mod [moddir]    -- specify an alternate mod dir\n"
                "\t-scripts [scriptsdir]      -- specify an alternate scripts dir\n";
 
        for (x = 1; x < argc; x++) {
@@ -478,6 +479,22 @@ int main(int argc, char *argv[])
                        known_opt++;
                }
 
+               if (argv[x] && !strcmp(argv[x], "-mod")) {
+                       x++;
+                       if (argv[x] && strlen(argv[x])) {
+                               SWITCH_GLOBAL_dirs.mod_dir = (char *) malloc(strlen(argv[x]) + 1);
+                               if (!SWITCH_GLOBAL_dirs.mod_dir) {
+                                       fprintf(stderr, "Allocation error\n");
+                                       return 255;
+                               }
+                               strcpy(SWITCH_GLOBAL_dirs.mod_dir, argv[x]);
+                       } else {
+                               fprintf(stderr, "When using -mod you must specify a module directory\n");
+                               return 255;
+                       }
+                       known_opt++;
+               }
+                               
                if (argv[x] && !strcmp(argv[x], "-log")) {
                        x++;
                        if (argv[x] && strlen(argv[x])) {