summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/bazarr.py b/bazarr.py
index 48a822268..abe2f5c53 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -30,20 +30,17 @@ def start_bazarr():
script = [sys.executable, os.path.normcase(os.path.join(os.path.dirname(__file__), 'bazarr/main.py'))] + globals()['arguments']
pidfile = os.path.normcase(os.path.join(os.path.dirname(__file__), 'bazarr.pid'))
- if os.path.exists(pidfile):
- logging.error("Bazarr already running, please stop it first.")
+ ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT)
+ try:
+ file = open(pidfile,'w')
+ except:
+ logging.error("Error trying to write pid file.")
else:
- ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT)
- try:
- file = open(pidfile,'w')
- except:
- logging.error("Error trying to write pid file.")
- else:
- file.write(str(ep.pid))
- file.close()
- logging.info("Bazarr starting with process id: " + str(ep.pid) + "...")
- for line in iter(ep.stdout.readline, ''):
- sys.stdout.write(line)
+ file.write(str(ep.pid))
+ file.close()
+ logging.info("Bazarr starting with process id: " + str(ep.pid) + "...")
+ for line in iter(ep.stdout.readline, ''):
+ sys.stdout.write(line)
def shutdown_bazarr(restarting):