2021-02-09 17:05:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
source /home/joinmarket/joinin.conf
|
|
|
|
|
source /home/joinmarket/_functions.sh
|
|
|
|
|
|
2021-03-02 10:23:13 +00:00
|
|
|
if [ "${runningEnv}" = standalone ]; then
|
|
|
|
|
source /home/joinmarket/standalone/_functions.standalone.sh
|
|
|
|
|
network=mainnet
|
|
|
|
|
elif [ "${runningEnv}" = raspiblitz ];then
|
|
|
|
|
source /mnt/hdd/raspiblitz.conf
|
|
|
|
|
if [ $network = bitcoin ];then
|
|
|
|
|
network=${chain}net
|
|
|
|
|
else
|
|
|
|
|
network=unsupported
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2021-02-09 17:05:39 +00:00
|
|
|
# BASIC MENU INFO
|
2021-03-02 10:23:13 +00:00
|
|
|
HEIGHT=12
|
|
|
|
|
WIDTH=64
|
2021-02-09 17:05:39 +00:00
|
|
|
CHOICE_HEIGHT=20
|
2021-02-10 21:03:24 +00:00
|
|
|
TITLE="Configuration options"
|
2021-02-09 17:05:39 +00:00
|
|
|
MENU=""
|
|
|
|
|
OPTIONS=()
|
|
|
|
|
BACKTITLE="JoininBox GUI"
|
|
|
|
|
|
|
|
|
|
# Basic Options
|
2021-02-15 11:31:41 +00:00
|
|
|
OPTIONS+=(
|
|
|
|
|
JMCONF "Edit the joinmarket.cfg manually"
|
|
|
|
|
CONNECT "Connect to a remote bitcoin node on mainnet"
|
2021-03-02 10:23:13 +00:00
|
|
|
SIGNET "Switch to signet with a local Bitcoin Core")
|
|
|
|
|
if [ "${runningEnv}" = standalone ]; then
|
|
|
|
|
OPTIONS+=(PRUNED "Start a pruned node locally from prunednode.today")
|
|
|
|
|
fi
|
|
|
|
|
if [ -f /home/bitcoin/.bitcoin/bitcoin.conf ];then
|
|
|
|
|
OPTIONS+=(LOCAL "Connect to the local Bitcoin Core on $network")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
OPTIONS+=(RESET "Reset the joinmarket.cfg to the defaults")
|
2021-02-09 17:05:39 +00:00
|
|
|
|
|
|
|
|
CHOICE=$(dialog --clear \
|
|
|
|
|
--backtitle "$BACKTITLE" \
|
|
|
|
|
--title "$TITLE" \
|
2021-03-04 11:21:57 +00:00
|
|
|
--ok-label "Select" \
|
|
|
|
|
--cancel-label "Back" \
|
2021-02-09 17:05:39 +00:00
|
|
|
--menu "$MENU" \
|
|
|
|
|
$HEIGHT $WIDTH $CHOICE_HEIGHT \
|
|
|
|
|
"${OPTIONS[@]}" \
|
|
|
|
|
2>&1 >/dev/tty)
|
|
|
|
|
|
|
|
|
|
case $CHOICE in
|
|
|
|
|
JMCONF)
|
|
|
|
|
/home/joinmarket/install.joinmarket.sh config
|
|
|
|
|
echo "Returning to the menu..."
|
|
|
|
|
sleep 1
|
|
|
|
|
/home/joinmarket/menu.sh
|
|
|
|
|
;;
|
2021-02-09 18:33:24 +00:00
|
|
|
RESET)
|
|
|
|
|
echo "# Removing the joinmarket.cfg"
|
2021-03-02 10:23:13 +00:00
|
|
|
rm -f $JMcfgPath
|
2021-02-09 18:33:24 +00:00
|
|
|
generateJMconfig
|
2021-02-09 18:36:30 +00:00
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
2021-02-09 18:33:24 +00:00
|
|
|
;;
|
2021-02-09 17:05:39 +00:00
|
|
|
CONNECT)
|
2021-02-13 13:56:33 +00:00
|
|
|
/home/joinmarket/install.bitcoincore.sh signetOff
|
2021-02-09 17:05:39 +00:00
|
|
|
/home/joinmarket/menu.bitcoinrpc.sh
|
|
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
|
|
|
|
;;
|
|
|
|
|
SIGNET)
|
2021-02-13 13:56:33 +00:00
|
|
|
/home/joinmarket/install.bitcoincore.sh signetOn
|
2021-02-09 17:05:39 +00:00
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
|
|
|
|
;;
|
2021-03-02 10:23:13 +00:00
|
|
|
PRUNED)
|
|
|
|
|
/home/joinmarket/install.bitcoincore.sh signetOff
|
|
|
|
|
installBitcoinCoreStandalone
|
|
|
|
|
echo
|
|
|
|
|
downloadSnapShot
|
|
|
|
|
installMainnet
|
|
|
|
|
connectLocalNode
|
|
|
|
|
showBitcoinLogs
|
|
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
|
|
|
|
;;
|
|
|
|
|
LOCAL)
|
|
|
|
|
connectLocalNode $network
|
2021-03-02 14:53:57 +00:00
|
|
|
sudo systemctl start bitcoind
|
|
|
|
|
showBitcoinLogs
|
2021-03-02 10:23:13 +00:00
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
|
|
|
|
;;
|
2021-02-09 17:05:39 +00:00
|
|
|
esac
|