mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
parent
03b35e645c
commit
687bd53bcb
4 changed files with 22 additions and 17 deletions
|
@ -247,24 +247,16 @@ namespace Ombi.Schedule.Jobs.Ombi
|
|||
sb.Append($"--windowsServiceName \"{settings.WindowsServiceName}\" ");
|
||||
}
|
||||
var sb2 = new StringBuilder();
|
||||
var hasStartupArgs = false;
|
||||
if (url?.Value.HasValue() ?? false)
|
||||
{
|
||||
hasStartupArgs = true;
|
||||
sb2.Append(url.Value);
|
||||
sb2.Append($" --host {url.Value}");
|
||||
}
|
||||
if (storage?.Value.HasValue() ?? false)
|
||||
{
|
||||
hasStartupArgs = true;
|
||||
sb2.Append(storage.Value);
|
||||
}
|
||||
if (hasStartupArgs)
|
||||
{
|
||||
sb.Append($"--startupArgs {sb2.ToString()}");
|
||||
sb2.Append($" --storage {storage.Value}");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
//return string.Join(" ", currentLocation, processName, url?.Value ?? string.Empty, storage?.Value ?? string.Empty);
|
||||
}
|
||||
|
||||
private void RunScript(UpdateSettings settings, string downloadUrl)
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
@ -78,12 +79,22 @@ namespace Ombi.Updater
|
|||
}
|
||||
else
|
||||
{
|
||||
var startupArgsBuilder = new StringBuilder();
|
||||
if (!string.IsNullOrEmpty(options.Host))
|
||||
{
|
||||
startupArgsBuilder.Append($"--host {options.Host} ");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(options.Storage))
|
||||
{
|
||||
startupArgsBuilder.Append($"--storage {options.Storage}");
|
||||
}
|
||||
|
||||
var start = new ProcessStartInfo
|
||||
{
|
||||
UseShellExecute = false,
|
||||
FileName = Path.Combine(options.ApplicationPath, fileName),
|
||||
WorkingDirectory = options.ApplicationPath,
|
||||
Arguments = options.StartupArgs
|
||||
Arguments = startupArgsBuilder.ToString()
|
||||
};
|
||||
using (var proc = new Process { StartInfo = start })
|
||||
{
|
||||
|
|
|
@ -78,8 +78,10 @@ namespace Ombi.Updater
|
|||
public string ApplicationPath { get; set; }
|
||||
[Option("processId", Required = false)]
|
||||
public int OmbiProcessId { get; set; }
|
||||
[Option("startupArgs", Required = false)]
|
||||
public string StartupArgs { get; set; }
|
||||
[Option("host", Required = false)]
|
||||
public string Host { get; set; }
|
||||
[Option("storage", Required = false)]
|
||||
public string Storage { get; set; }
|
||||
[Option("windowsServiceName", Required = false)]
|
||||
public string WindowsServiceName { get; set; }
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Ombi
|
|||
url = new ApplicationConfiguration
|
||||
{
|
||||
Type = ConfigurationTypes.Url,
|
||||
Value = "http://*"
|
||||
Value = "http://*:5000"
|
||||
};
|
||||
|
||||
ctx.ApplicationConfigurations.Add(url);
|
||||
|
@ -93,13 +93,13 @@ namespace Ombi
|
|||
|
||||
public class Options
|
||||
{
|
||||
[Option('h', "host", Required = false, HelpText =
|
||||
[Option("host", Required = false, HelpText =
|
||||
"Set to a semicolon-separated (;) list of URL prefixes to which the server should respond. For example, http://localhost:123." +
|
||||
" Use \"*\" to indicate that the server should listen for requests on any IP address or hostname using the specified port and protocol (for example, http://*:5000). " +
|
||||
"The protocol (http:// or https://) must be included with each URL. Supported formats vary between servers.", Default = "http://*:5000")]
|
||||
public string Host { get; set; }
|
||||
|
||||
[Option('s', "storage", Required = false, HelpText = "Storage path, where we save the logs and database")]
|
||||
|
||||
[Option("storage", Required = false, HelpText = "Storage path, where we save the logs and database")]
|
||||
public string StoragePath { get; set; }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue