2021-05-06 20:37:40 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2021-05-07 14:46:03 +01:00
|
|
|
# repeatedly used menu items as functions
|
|
|
|
|
|
2022-03-02 18:36:01 +03:00
|
|
|
# paths
|
|
|
|
|
walletPath="/home/joinmarket/.joinmarket/wallets/"
|
|
|
|
|
JMcfgPath="/home/joinmarket/.joinmarket/joinmarket.cfg"
|
|
|
|
|
joininConfPath="/home/joinmarket/joinin.conf"
|
|
|
|
|
|
2021-05-07 14:46:03 +01:00
|
|
|
function menu_GEN() {
|
2021-05-06 20:37:40 +01:00
|
|
|
clear
|
2022-03-02 18:36:01 +03:00
|
|
|
echo
|
2021-05-06 20:37:40 +01:00
|
|
|
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
|
2022-03-02 18:36:01 +03:00
|
|
|
if [ "${RPCoverTor}" = "on" ]; then
|
2021-10-03 00:37:34 +01:00
|
|
|
torsocks python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py generate
|
2021-05-06 20:37:40 +01:00
|
|
|
else
|
|
|
|
|
python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py generate
|
|
|
|
|
fi
|
|
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu"
|
|
|
|
|
read key
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-07 14:46:03 +01:00
|
|
|
function menu_MAKER() {
|
2021-05-06 20:37:40 +01:00
|
|
|
# wallet
|
2021-05-13 14:42:30 +01:00
|
|
|
chooseWallet noLockFileCheck
|
2021-05-06 20:37:40 +01:00
|
|
|
# save wallet in conf
|
|
|
|
|
sudo sed -i "s#^YGwallet=.*#YGwallet=$(cat $wallet)#g" $joininConfPath
|
|
|
|
|
# get password
|
|
|
|
|
passwordToFile
|
|
|
|
|
echo "# Using the wallet: $(cat $wallet)"
|
|
|
|
|
/home/joinmarket/start.service.sh yg-privacyenhanced $(cat $wallet)
|
|
|
|
|
echo
|
|
|
|
|
echo "# started the Yield Generator in the background"
|
|
|
|
|
echo
|
|
|
|
|
echo "# showing the systemd status ..."
|
|
|
|
|
sleep 3
|
|
|
|
|
dialog \
|
|
|
|
|
--title "Monitoring the Yield Generator - press CTRL+C to exit" \
|
|
|
|
|
--prgbox "sudo journalctl -fn20 -u yg-privacyenhanced" 30 200
|
|
|
|
|
echo "# returning to the menu..."
|
|
|
|
|
sleep 1
|
|
|
|
|
/home/joinmarket/menu.yg.sh
|
2021-05-07 14:46:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function menu_DISPLAY() {
|
|
|
|
|
checkRPCwallet
|
|
|
|
|
# wallet
|
2021-05-13 14:42:30 +01:00
|
|
|
chooseWallet noLockFileCheck
|
2021-05-07 14:46:03 +01:00
|
|
|
/home/joinmarket/start.script.sh wallet-tool "$(cat $wallet)"
|
|
|
|
|
echo
|
|
|
|
|
echo "Fund the wallet on addresses labeled 'new' to avoid address reuse."
|
|
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu..."
|
|
|
|
|
read key
|
|
|
|
|
/home/joinmarket/menu.sh
|
2021-12-08 09:00:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function menu_resetJMconfig {
|
|
|
|
|
dialog --backtitle "Reset the joinmarket.cfg" \
|
|
|
|
|
--title "Reset the joinmarket.cfg" \
|
|
|
|
|
--yesno "
|
2022-05-09 19:36:44 +01:00
|
|
|
A new JoinMarket version might introduce new options and changed defaults.
|
2021-12-08 09:00:37 +00:00
|
|
|
It is best to reset the joinmarket.cfg after every install.
|
|
|
|
|
(can be done any time from the menu CONFIG -> RESET)
|
|
|
|
|
|
2022-05-09 19:36:44 +01:00
|
|
|
Do you want to reset the joinmarket.cfg to the defaults now?
|
2021-12-08 09:00:37 +00:00
|
|
|
" 12 65
|
2023-07-23 06:35:04 +00:00
|
|
|
# make decision
|
2021-12-08 09:00:37 +00:00
|
|
|
pressed=$?
|
|
|
|
|
case $pressed in
|
|
|
|
|
0)
|
|
|
|
|
echo "# Removing the joinmarket.cfg"
|
|
|
|
|
rm -f $JMcfgPath
|
|
|
|
|
generateJMconfig;;
|
|
|
|
|
1)
|
|
|
|
|
echo "Cancelled"
|
|
|
|
|
exit 1;;
|
|
|
|
|
255)
|
|
|
|
|
echo "ESC pressed."
|
|
|
|
|
exit 1;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function menu_connectLocalCore {
|
|
|
|
|
dialog --backtitle "Connect to the local Bitcoin Core" \
|
|
|
|
|
--title "Connect to the local Bitcoin Core" \
|
|
|
|
|
--yesno "
|
|
|
|
|
Do you want to connect to the local Bitcoin Core on mainnet now?" 7 55
|
2023-07-23 06:35:04 +00:00
|
|
|
# make decision
|
2021-12-08 09:00:37 +00:00
|
|
|
pressed=$?
|
|
|
|
|
case $pressed in
|
|
|
|
|
0)
|
|
|
|
|
connectLocalNode mainnet
|
|
|
|
|
sudo systemctl start bitcoind
|
|
|
|
|
showBitcoinLogs;;
|
|
|
|
|
1)
|
|
|
|
|
echo "Cancelled"
|
|
|
|
|
exit 1;;
|
|
|
|
|
255)
|
|
|
|
|
echo "ESC pressed."
|
|
|
|
|
exit 1;;
|
|
|
|
|
esac
|
2021-05-06 20:37:40 +01:00
|
|
|
}
|