]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix command line args when config file present
authorMichael Jerris <mike@jerris.com>
Fri, 26 Dec 2008 21:10:40 +0000 (21:10 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 26 Dec 2008 21:10:40 +0000 (21:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10963 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/fs_cli.c

index 3f0d931ee8532376e84b9ad4362d18f0319a85a7..efdee503d8eed4d92174879d441a13ce515c1aef 100644 (file)
@@ -365,16 +365,6 @@ int main(int argc, char *argv[])
                }
                esl_config_close_file(&cfg);
        }
-
-       if (argv_host) {
-               esl_set_string(profiles[cur].host, temp_host);
-       }
-       if (argv_port) {
-               profiles[cur].port = (esl_port_t)temp_port;
-       }
-       if (argv_pass) {
-               esl_set_string(profiles[cur].pass, temp_pass);
-       }
        
        if (optind < argc) {
                if (get_profile(argv[optind], &profile)) {
@@ -388,10 +378,20 @@ int main(int argc, char *argv[])
                }
        }
        
+       if (argv_host) {
+               esl_set_string(profile->host, temp_host);
+       }
+       if (argv_port) {
+               profile->port = (esl_port_t)temp_port;
+       }
+       if (argv_pass) {
+               esl_set_string(profile->pass, temp_pass);
+       }
+
        esl_log(ESL_LOG_INFO, "Using profile %s [%s]\n", profile->name, profile->host);
        
        if (argv_host) {
-               snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->host);
+               snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s@%s> ", profile->host, profile->name);
        } else {
                snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
        }