From f71ede45f8faae5882f0328c578bd51819b0049f Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 26 Nov 2013 20:03:57 +0100 Subject: [PATCH] Exit if pid file already exists --- overviewer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overviewer.py b/overviewer.py index 2f85384..a1cb800 100755 --- a/overviewer.py +++ b/overviewer.py @@ -140,6 +140,9 @@ def main(): return 0 if options.pid: + if os.path.exists(options.pid): + print("Already running (pid exists) - exiting..") + return 0 with open(options.pid,"w") as f: f.write(str(os.getpid())) # if --check-terrain was specified, but we have NO config file, then we cannot