From: ThomasV Date: Tue, 25 Feb 2014 00:29:21 +0000 (+0100) Subject: check pid before start X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=5bf13f457fcb02e4cf1de3796064d9ce4041e07e check pid before start --- 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 &