private void InstallServer(InstallationProgressStep progressStep, FileMap runServerScript, string serverScriptParam = "") { InstallationProgress.Step = progressStep; CacheHelper.SetInstallationProgress(UserId, InstallationProgress); using (var stream = SshClient.CreateShellStream("terminal", 150, 24, 800, 600, 1024)) { stream.WriteLine(!string.IsNullOrEmpty(serverScriptParam) ? string.Format("sudo bash {0} \"{1}\"", runServerScript.RemotePath, serverScriptParam) : string.Format("sudo bash {0}", runServerScript.RemotePath)); var output = stream.Expect(Settings.InstallationStopPattern); if (output.Contains(Settings.InstallationSuccessPattern)) { InstallationProgress.ProgressText += output; } if (output.Contains(Settings.InstallationErrorPattern)) { throw new Exception(output); } } }
private void InstallServer(InstallationProgressStep progressStep, FileMap runServerScript, string serverScriptParam = "") { InstallationProgress.Step = progressStep; CacheHelper.SetInstallationProgress(UserId, InstallationProgress); using (var stream = SshClient.CreateShellStream("terminal", 150, 24, 800, 600, 1024)) { stream.WriteLine(!string.IsNullOrEmpty(serverScriptParam) ? string.Format("sudo bash {0} \"{1}\"", runServerScript.RemotePath, serverScriptParam) : string.Format("sudo bash {0}", runServerScript.RemotePath)); var output = stream.Expect(Settings.InstallationStopPattern); if (output.Contains(Settings.InstallationSuccessPattern)) InstallationProgress.ProgressText += output; if (output.Contains(Settings.InstallationErrorPattern)) throw new Exception(output); } }