Private GIT

Skip to content
Snippets Groups Projects
Select Git revision
  • 16f3118e8338651d1d730d42ff4c052af7a1ecf2
  • master default protected
  • fix_nzb_cat
  • develop
  • guessit2-minimal
  • ssl_warning
  • UHD-qualities
  • fix_providers8
  • !
  • tvvault
  • provider_alpharatio
  • v5.1.1
  • v5.1
  • v5.0.3
  • v5.0.2
  • v5.0.1
  • v5.0
  • v4.2.1.07
  • v4.2.1.06
  • v4.2.1.05
  • v4.2.1.04
  • v4.2.1.03
  • v4.2.1.02
  • v4.2.1.01
  • v4.2.1.0
  • v4.2.0.6
  • v4.2.0.5
  • v4.2.0.4
  • v4.2.0.3
  • v4.2.0.2
  • v4.2.0.1
31 results

SickBeard.py

Blame
  • Program.cs 9.19 KiB
    using CommandLine;
    using Jackett.Services;
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Web;
    /*
    // no supported by appveyor, disabeling for now
    #if __MonoCS__
    using Mono.Unix.Native;
    #endif
    */
    
    namespace Jackett.Updater
    {
        class Program
        {
            static void Main(string[] args)
            {
                new Program().Run(args);
            }
    
            private void Run(string[] args)
            {
                Engine.SetupLogging(null, "updater.txt");
                Engine.Logger.Info("Jackett Updater v" + GetCurrentVersion());
                Engine.Logger.Info("Options \"" + string.Join("\" \"", args) + "\"");
                try {
                    var options = new UpdaterConsoleOptions();
                    if (Parser.Default.ParseArguments(args, options))
                    {
                        ProcessUpdate(options);
                    }
                    else
                    {
                        Engine.Logger.Error("Failed to process update arguments!");
                        Console.ReadKey();
                    }
                }
                catch (Exception e)
                {
                    Engine.Logger.Error(e, "Exception applying update!");
                }
            }
    
            private string GetCurrentVersion()
            {
                var assembly = System.Reflection.Assembly.GetExecutingAssembly();
                var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
                return fvi.FileVersion;
            }
    
            private void KillPids(int[] pids)
            {
                foreach (var pid in pids)
                {
                    try
                    {
                        var proc = Process.GetProcessById(pid);
                        Engine.Logger.Info("Killing process " + proc.Id);
                        proc.Kill();
                        var exited = proc.WaitForExit(5000);
                        if (!exited)
                            Engine.Logger.Info("Process " + pid.ToString() + " didn't exit within 5 seconds");