1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-09-19 10:10:40 +03:00

possible to provide hostname with an argument

This commit is contained in:
ELIN 2014-01-28 05:30:57 +00:00
parent 001fd910fe
commit 504c2eb483

View File

@ -11799,9 +11799,17 @@ RETRY:
void MainCM() void MainCM()
{ {
// If there is /remote in the argument, show the screen of the remote connection // If there is /remote in the argument, show the screen of the remote connection
char *cmdline = GetCommandLineStr(); TOKEN_LIST *cmdline = GetCommandLineToken();
if (StrCmpi(cmdline, "/remote") == 0) if (cmdline->NumTokens >= 1)
{
if (StrCmpi(cmdline->Token[0], "/remote") == 0)
{
if (cmdline->NumTokens >= 2)
{
cm->server_name = CopyStr(cmdline->Token[1]);
}
else
{ {
char *hostname = RemoteDlg(NULL, CM_REG_KEY, ICO_VPN, _UU("CM_TITLE"), _UU("CM_REMOTE_TITLE"), NULL); char *hostname = RemoteDlg(NULL, CM_REG_KEY, ICO_VPN, _UU("CM_TITLE"), _UU("CM_REMOTE_TITLE"), NULL);
if (hostname == NULL) if (hostname == NULL)
@ -11818,14 +11826,16 @@ void MainCM()
cm->server_name = hostname; cm->server_name = hostname;
} }
} }
}
if (StrCmpi(cmdline, "/startup") == 0) if (StrCmpi(cmdline->Token[0], "/startup") == 0)
{ {
// Startup mode // Startup mode
cm->StartupMode = true; cm->StartupMode = true;
} }
}
Free(cmdline); FreeToken(cmdline);
if (IsZero(cm->ShortcutKey, SHA1_SIZE) == false) if (IsZero(cm->ShortcutKey, SHA1_SIZE) == false)
{ {