Ported to python 3.6.13

This commit is contained in:
Caleb Herpin 2021-07-28 18:06:55 -05:00
parent 644e945c79
commit 0db8f7afc5

View File

@ -87,11 +87,12 @@ params = Params()
def is_web_server_started():
for _ in range(20): #Wait 2 seconds i.e 20 * .1 seconds, must wait for service to get to listening state.
cmd = f"echo \"netstat -tulpan | grep {params.get_port()}\" | /bin/bash"
p = subprocess.run(cmd, capture_output=True, shell=True)
# p = subprocess.run(cmd, capture_output=True, shell=True)
output = subprocess.getoutput(cmd)
print("runing........", cmd)
print(f"Checking for port output: {p.stdout}")
print(f"Error is: {p.stderr}")
print(f"Checking for port output: {output}")
print(f"Error is: {output}")
sleep(.1) #We sleep to use less recourses
if "LISTEN" in p.stdout.decode():
if "LISTEN" in output:
return True
return False