add foundry script
[electrum-server.git] / start
1 #!/bin/bash
2
3 path=`grep path_fulltree /etc/electrum.conf |awk -F\= '{print $2}'`
4
5 if [ ! -d $path ]; then
6     echo "Database not found in $path."
7     read -p "Do you want to download it from the Electrum foundry? " -n 1 -r
8     echo
9     if [[ $REPLY =~ ^[Yy]$ ]]; then
10         rm -rf fulltree fulltree.tar
11         wget http://ecdsa.net/fulltree.tar 
12         tar -xvf fulltree.tar
13         mv fulltree $path
14         rm -rf fulltree fulltree.tar
15     fi
16 fi
17
18 echo "starting server as daemon"
19 nohup /usr/bin/python -u server.py &> /var/log/electrum.log &