joinmarket: simplify startup and skip in tmux

This commit is contained in:
openoms 2020-04-11 23:10:18 +01:00
parent b855bad854
commit 884016592e
No known key found for this signature in database
GPG key ID: 5BFB77609B081B65

View file

@ -30,7 +30,7 @@ if [ "$1" = "menu" ]; then
whiptail --title " JoinMarket info " --msgbox "Usage:
https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md\n
Start to use by logging in to the 'joinmarket' user with:
'sudo su - joinmarket' \n
sudo su joinmarket\n
Can log in directly with the 'joinmarket' user via ssh.
The user password is the PASSWORD_B.
" 14 81
@ -109,18 +109,15 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
pip install https://github.com/sunu/qt5reactor/archive/58410aaead2185e9917ae9cac9c50fe7b70e4a60.zip#egg=qt5reactor
# autostart for joinmarket
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "bash startup.sh") -eq 0 ]; then
sudo bash -c "echo 'bash startup.sh' >> /home/joinmarket/.bashrc"
fi
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c ". /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate") -eq 0 ]; then
sudo bash -c "echo '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate' >> /home/joinmarket/.bashrc"
fi
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"") -eq 0 ]; then
sudo bash -c "echo '/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"' >> /home/joinmarket/.bashrc"
fi
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "cd /home/joinmarket/joinmarket-clientserver/scripts/") -eq 0 ]; then
sudo bash -c "echo 'cd /home/joinmarket/joinmarket-clientserver/scripts/' >> /home/joinmarket/.bashrc"
fi
bash -c "echo '# automatically start startup.sh for joinmarket unless' >> /home/joinmarket/.bashrc"
bash -c "echo '# when running in a tmux session' >> /home/joinmarket/.bashrc"
bash -c "echo 'if [ -z \"\$TMUX\" ]; then' >> /home/joinmarket/.bashrc"
bash -c "echo ' /home/joinmarket/startup.sh' >> /home/joinmarket/.bashrc"
bash -c "echo 'fi' >> /home/joinmarket/.bashrc"
bash -c "echo '# always activate jmvenv with PySide2 and cd to scripts' >> /home/joinmarket/.bashrc"
bash -c "echo '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate' >> /home/joinmarket/.bashrc"
bash -c "echo '/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"' >> /home/joinmarket/.bashrc"
bash -c "echo 'cd /home/joinmarket/joinmarket-clientserver/scripts/' >> /home/joinmarket/.bashrc"
cat > /home/admin/startup.sh <<EOF
# check for joinmarket.cfg
@ -181,7 +178,7 @@ EOF
# starting info
echo ""
echo "Start to use by logging in to the 'joinmarket' user with:"
echo "'sudo su - joinmarket'"
echo "sudo su joinmarket"
echo ""
echo "If logging in directly via ssh the password is the PASSWORD_B"
echo ""