summaryrefslogtreecommitdiff
path: root/ewww.py
diff options
context:
space:
mode:
Diffstat (limited to 'ewww.py')
-rw-r--r--ewww.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ewww.py b/ewww.py
index 2e45aa9..4f06b47 100644
--- a/ewww.py
+++ b/ewww.py
@@ -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.