#!/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
read -p "Do you want to download it from the Electrum foundry to $path ? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
- wget -O - "http://foundry.electrum.org/leveldb-dump/electrum-fulltree-100-latest.tar,gz" | tar -C $path --strip-components 1 -xvfz -
+ wget -O - "http://foundry.electrum.org/leveldb-dump/electrum-fulltree-100-latest.tar.gz" | tar -C $path --strip-components 1 -xvfz -
fi
fi
-echo "starting server as daemon"
+echo "Starting server as daemon"
nohup /usr/bin/python -u server.py &> /var/log/electrum.log &