X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=start;h=e00bdd9c57aa182a5770ac7de8f185e036b8c5d2;hp=5b29aef98f107f48a5bb81e63adea91badcf146f;hb=45ed65739b01ac0c981340e5a07e56da2cf3a68d;hpb=6289867279abad7ddbb1d1e782018191ab759bb3 diff --git a/start b/start index 5b29aef..e00bdd9 100755 --- a/start +++ b/start @@ -1,2 +1,19 @@ #!/bin/bash -nohup /usr/bin/python -u server.py &>> /var/log/electrum.log & + +path=`grep path_fulltree /etc/electrum.conf |awk -F\= '{print $2}'` + +if [ ! -d $path ]; then + echo "Database not found in $path." + read -p "Do you want to download it from the Electrum foundry? " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + rm -rf fulltree fulltree.tar + wget http://foundry.electrum.org/leveldb-dump/electrum-fulltree-100-latest.tar -O fulltree.tar + tar -xvf fulltree.tar + mv fulltree $path + rm -rf fulltree fulltree.tar + fi +fi + +echo "starting server as daemon" +nohup /usr/bin/python -u server.py &> /var/log/electrum.log &