private static void CreateService() { if (service != null) { service.Dispose(); } service = IPBanService.CreateService <IPBanService>(); service.Start(); }
public static void MacMain(string[] args) { IPBanService service = IPBanService.CreateService(); service.Start(); IPBanLog.Warn("IPBan Mac Service Running, Press Ctrl-C to quit."); ManualResetEvent wait = new ManualResetEvent(false); wait.WaitOne(); }
private static void CreateService(bool testing) { if (service != null) { service.Dispose(); } service = IPBanService.CreateService(testing); service.Start(); eventViewer = new IPBanWindowsEventViewer(service); }
public static void LinuxMain(string[] args) { bool testing = false; // TODO: Change to true if we are running Linux tests IPBanService service = IPBanService.CreateService(testing); service.Start(); IPBanLog.Write(LogLevel.Warning, "IPBan Linux Service Running, Press Ctrl-C to quit."); ManualResetEvent wait = new ManualResetEvent(false); wait.WaitOne(); }
public static int RunConsole(string[] args) { IPBanService service = CreateService(); if (args.Contains("test", StringComparer.OrdinalIgnoreCase)) { service.RunTestsOnStart = true; } service.Start(); Console.WriteLine("Press ENTER to quit"); Console.ReadLine(); service.Stop(); return(0); }
private static void CreateService(bool test) { if (service != null) { service.Dispose(); } service = IPBanService.CreateService(); if (test) { // TODO: Move to unit test project service.MultiThreaded = false; service.ManualCycle = true; service.SubmitIPAddresses = false; service.DB.Truncate(true); } service.Start(); // attach Windows event viewer to the service eventViewer = new IPBanWindowsEventViewer(service); }
protected override void OnStart(string[] args) { base.OnStart(args); service = CreateService(); service.Start(); }