From 7d2080a1d1d472ae27618207d2003e3a13d9dd59 Mon Sep 17 00:00:00 2001 From: KF Date: Tue, 27 Aug 2019 21:15:56 -0500 Subject: [PATCH] added taskkill hack for killing onionr's Tor process on Windows --- onionr/netcontroller/netcontrol.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onionr/netcontroller/netcontrol.py b/onionr/netcontroller/netcontrol.py index b37c20bc..f561c937 100644 --- a/onionr/netcontroller/netcontrol.py +++ b/onionr/netcontroller/netcontrol.py @@ -18,6 +18,7 @@ along with this program. If not, see . ''' import os, sys, base64, subprocess, signal, time +import platform # For windows sigkill workaround import config, logger from . import getopenport from utils import identifyhome @@ -184,6 +185,11 @@ HiddenServicePort 80 ''' + self.apiServerIP + ''':''' + str(self.hsPort) except FileNotFoundError: pass time.sleep(TOR_KILL_WAIT) + + if 'windows' == platform.system().lower(): + os.system('taskkill /PID %s /F' % (pidN,)) + time.sleep(0.5) + return try: os.kill(int(pidN), signal.SIGKILL) except (ProcessLookupError, PermissionError) as e: