From 9caccc5f93932432939e52bd9a0dc10f0167b287 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Wed, 1 Feb 2017 12:25:02 +0100 Subject: [PATCH] Print issue file during startup --- src/Jackett/Services/ServerService.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Jackett/Services/ServerService.cs b/src/Jackett/Services/ServerService.cs index e79757f52..a90f1887d 100644 --- a/src/Jackett/Services/ServerService.cs +++ b/src/Jackett/Services/ServerService.cs @@ -155,7 +155,27 @@ namespace Jackett.Services var x = Environment.OSVersion; var runtimedir = RuntimeEnvironment.GetRuntimeDirectory(); logger.Info("Environment version: " + Environment.Version.ToString() + " (" + runtimedir + ")"); - logger.Info("OS version: " + Environment.OSVersion.ToString() + (Environment.Is64BitOperatingSystem ? " (64bit OS)" : "") + (Environment.Is64BitProcess ? " (64bit process)" : "")); + logger.Info("OS version: " + Environment.OSVersion.ToString() + (Environment.Is64BitOperatingSystem ? " (64bit OS)" : "") + (Environment.Is64BitProcess ? " (64bit process)" : "")); + + try + { + var issuefile = "/etc/issue"; + if (File.Exists(issuefile)) + { + using (StreamReader reader = new StreamReader(issuefile)) + { + string firstLine; + firstLine = reader.ReadLine(); + if (firstLine != null) + logger.Info("issue: " + firstLine); + } + } + } + catch (Exception e) + { + logger.Error(e, "Error while reading the issue file"); + } + Type monotype = Type.GetType("Mono.Runtime"); if (monotype != null) {