From 5bf13f457fcb02e4cf1de3796064d9ce4041e07e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 25 Feb 2014 01:29:21 +0100 Subject: [PATCH] check pid before start --- start | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/start b/start index 8cf88b6..6bf6668 100755 --- a/start +++ b/start @@ -1,5 +1,12 @@ #!/bin/bash +PID=`/usr/bin/python server.py getpid` +if [[ $PID != *[!0-9]* ]]; then + echo "Server already running (pid $PID)" + exit +fi + + electrum_config="/etc/electrum.conf" if [ ! -f $electrum_config ]; then @@ -26,5 +33,5 @@ if [ ! -d $path ]; then fi fi -echo "starting server as daemon" +echo "Starting server as daemon" nohup /usr/bin/python -u server.py &> /var/log/electrum.log & -- 1.7.1