diff options
Diffstat (limited to 'ewww.py')
-rw-r--r-- | ewww.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -6,6 +6,7 @@ import os import random import re import shutil +import signal import subprocess import time import urllib.parse @@ -100,7 +101,12 @@ def start_server(ctx, filename=None): ) _run_exit(ctx, 0) - ctx["pid"] = open("ewww.pid").read() + ctx["pid"] = int(open("ewww.pid").read().strip()) + + +# Stop previously started server. +def stop_server(ctx): + os.kill(ctx["pid"], signal.SIGKILL) # Make a HTTP request. |