0

Exit if pid file already exists

This commit is contained in:
Robin
2013-11-26 20:03:57 +01:00
parent 681d990f90
commit f71ede45f8

View File

@@ -140,6 +140,9 @@ def main():
return 0 return 0
if options.pid: if options.pid:
if os.path.exists(options.pid):
print("Already running (pid exists) - exiting..")
return 0
with open(options.pid,"w") as f: with open(options.pid,"w") as f:
f.write(str(os.getpid())) f.write(str(os.getpid()))
# if --check-terrain was specified, but we have NO config file, then we cannot # if --check-terrain was specified, but we have NO config file, then we cannot