diff options
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 0f2a90900..e1d3cda40 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -16,6 +16,7 @@ using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using System.Reflection; +using System.Linq; // MONOMKBUNDLE: For the embedded version, mkbundle tool #if MONOMKBUNDLE using Mono.Unix; @@ -39,8 +40,13 @@ namespace MediaBrowser.Server.Mono #else var applicationPath = Assembly.GetEntryAssembly ().Location; #endif + + var commandArgs = Environment.GetCommandLineArgs(); + + // Allow this to be specified on the command line. + var customProgramDataPath = commandArgs.ElementAtOrDefault(1); - var appPaths = CreateApplicationPaths(applicationPath); + var appPaths = CreateApplicationPaths(applicationPath, customProgramDataPath); var logManager = new NlogManager(appPaths.LogDirectoryPath, "server"); logManager.ReloadLogger(LogSeverity.Info); @@ -70,9 +76,14 @@ namespace MediaBrowser.Server.Mono } } - private static ServerApplicationPaths CreateApplicationPaths(string applicationPath) + private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath) { - return new ServerApplicationPaths(applicationPath); + if (string.IsNullOrEmpty(programDataPath)) + { + return new ServerApplicationPaths(applicationPath); + } + + return new ServerApplicationPaths(programDataPath, applicationPath); } /// <summary> |
