diff --git a/Defs/ActionManager/Server/server_runner.py b/Defs/ActionManager/Server/server_runner.py index 6225f49..6d7044b 100644 --- a/Defs/ActionManager/Server/server_runner.py +++ b/Defs/ActionManager/Server/server_runner.py @@ -17,6 +17,9 @@ from Defs.ImportManager.unsorted_will_be_replaced import chmod from Defs.ImportManager.unsorted_will_be_replaced import DEVNULL from Defs.ImportManager.unsorted_will_be_replaced import ngrok from Defs.ImportManager.unsorted_will_be_replaced import ngrok_conf +from Defs.ImportManager.unsorted_will_be_replaced import check_process +from Defs.ImportManager.unsorted_will_be_replaced import kill +from Defs.ImportManager.unsorted_will_be_replaced import signal from Defs.ImportManager.unsorted_will_be_replaced import path from Defs.ImportManager.unsorted_will_be_replaced import regular_expression from Defs.ImportManager.unsorted_will_be_replaced import requests @@ -120,7 +123,10 @@ def start_localhost(port): def start_ngrok(port): ngrok_conf.PyngrokConfig(config_path=".config/ngrok.yml") - run_command(["killall", "-2", "ngrok"], stdout=DEVNULL, stderr=DEVNULL) + pid = check_process("ngrok") + for p in pid: + kill(p, signal.SIGKILL) + # continue run_command("clear") print(global_localization.hidden_eye_logo) print(global_localization.official_website_link) diff --git a/Defs/ImportManager/unsorted_will_be_replaced.py b/Defs/ImportManager/unsorted_will_be_replaced.py index 81f712e..7670e90 100644 --- a/Defs/ImportManager/unsorted_will_be_replaced.py +++ b/Defs/ImportManager/unsorted_will_be_replaced.py @@ -20,6 +20,7 @@ from os import path from os import remove from os import replace from os import system +from os import kill from pathlib import Path as pathlib_Path from shutil import copyfile from shutil import rmtree @@ -33,7 +34,10 @@ from subprocess import Popen as run_background_command from time import sleep as wait from urllib import request as url_request from zipfile import ZipFile +from pgrep import pgrep as check_process import requests +import signal from pyngrok import conf as ngrok_conf from pyngrok import ngrok + diff --git a/requirements.txt b/requirements.txt index a872a5c..85b3171 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,5 @@ pyngrok==4.1.10 PyYAML==5.3.1 requests==2.23.0 urllib3==1.25.10 +pgrep==2020.7.1 +kill==2020.7.1