twister_script/twister_install.sh

68 lines
1.7 KiB
Bash
Raw Normal View History

2014-09-17 12:18:27 +08:00
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Created by twitter.com/Kurobeats
# Install
DIRECTORY=".twister"
2017-05-13 09:58:01 +08:00
ip_address="127.0.0.1"
2014-09-17 12:18:27 +08:00
echo -e "Please setup the username and password.\n"
echo -e "Username: "
read user
echo -e "\nPassword: "
2017-05-13 09:58:01 +08:00
read passwd
2014-09-17 12:18:27 +08:00
if [ ! -d ~/${DIRECTORY} ]; then
echo -e "\nCreating $DIRECTORY directory\n"
mkdir ~/${DIRECTORY}
fi
cd ~/${DIRECTORY}
echo -e "Installing needed packages\n"
2017-05-13 09:58:01 +08:00
sudo apt update && sudo apt -y install git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev automake
2014-09-17 12:18:27 +08:00
echo -e "Downloading required packages\n"
git clone https://github.com/miguelfreitas/twister-core.git
cd ./twister-core
./autotool.sh
2017-05-13 09:58:01 +08:00
./configure
2014-09-17 12:18:27 +08:00
make
# Configuration & web gui
2017-05-13 09:58:01 +08:00
echo -e "rpcuser=${user}\nrpcpassword=${passwd}" > ~/.twister/twister.conf
2014-09-17 12:18:27 +08:00
chmod 600 ~/.twister/twister.conf
git clone https://github.com/miguelfreitas/twister-html.git ~/.twister/html
# Start
2017-05-13 09:58:01 +08:00
./twisterd -rpcuser=${user} -rpcpassword=${passwd} -rpcallowip=${ip_address} &
disown
2017-05-13 09:58:01 +08:00
echo -e "Service started at http://localhost:28332/index.html"
2014-09-17 12:50:19 +08:00
exit