2021-03-06 11:11:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2021-05-06 20:37:40 +01:00
|
|
|
# QUICKSTART menu options
|
2021-03-06 11:11:45 +00:00
|
|
|
|
|
|
|
|
source /home/joinmarket/joinin.conf
|
|
|
|
|
source /home/joinmarket/_functions.sh
|
|
|
|
|
|
2021-05-09 23:57:50 +01:00
|
|
|
checkRPCwallet
|
|
|
|
|
|
2021-03-06 11:11:45 +00:00
|
|
|
function cacheAndShowQR() {
|
|
|
|
|
# cache wallet data
|
2021-09-02 12:01:58 +01:00
|
|
|
trap 'rm -f "$walletData"' EXIT
|
2021-03-06 11:11:45 +00:00
|
|
|
walletData=$(mktemp -p /dev/shm/)
|
|
|
|
|
clear
|
|
|
|
|
/home/joinmarket/start.script.sh wallet-tool "$(cat $wallet)" nomethod 0 2>&1 | tee $walletData
|
|
|
|
|
firstNewAddress=$(cat "$walletData" | grep "0.00000000 new" | sed -n 1p | awk '{print $2}')
|
|
|
|
|
echo
|
|
|
|
|
if [ ${#firstNewAddress} -eq 0 ]; then
|
|
|
|
|
echo "# Error: missing address data"
|
|
|
|
|
echo
|
|
|
|
|
echo "# Type 'menu' to return"
|
|
|
|
|
echo
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
# display data
|
|
|
|
|
cat "$walletData"
|
|
|
|
|
echo
|
|
|
|
|
echo "Fund the wallet on the first 'new' address to get started (displayed as a QR code also):"
|
|
|
|
|
echo "$firstNewAddress"
|
|
|
|
|
echo
|
|
|
|
|
qrencode -t ANSIUTF8 "${firstNewAddress}"
|
|
|
|
|
echo
|
|
|
|
|
shred $wallet $mixdepth $walletData
|
|
|
|
|
sudo rm -f /dev/shm/*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# BASIC MENU INFO
|
2021-05-07 14:46:03 +01:00
|
|
|
HEIGHT=11
|
2021-03-06 11:11:45 +00:00
|
|
|
WIDTH=52
|
2021-05-07 14:46:03 +01:00
|
|
|
CHOICE_HEIGHT=5
|
2021-05-06 20:37:40 +01:00
|
|
|
TITLE="Quickstart options"
|
|
|
|
|
BACKTITLE="Quickstart options"
|
2021-03-06 11:11:45 +00:00
|
|
|
MENU=""
|
|
|
|
|
OPTIONS=()
|
|
|
|
|
|
|
|
|
|
# Basic Options
|
|
|
|
|
OPTIONS+=(
|
2021-05-06 20:37:40 +01:00
|
|
|
GEN "Generate a new wallet"
|
2021-03-06 11:11:45 +00:00
|
|
|
m0 "Show the first mixdepth to deposit to"
|
2021-05-07 14:46:03 +01:00
|
|
|
DISPLAY "Show the contents of all mixdepths"
|
2021-05-06 20:37:40 +01:00
|
|
|
MAKER "Run the Yield Generator"
|
2021-03-06 11:11:45 +00:00
|
|
|
DOCS "Link to the documentation"
|
|
|
|
|
)
|
|
|
|
|
|
2021-05-06 20:37:40 +01:00
|
|
|
CHOICE=$(dialog \
|
|
|
|
|
--clear \
|
|
|
|
|
--backtitle "$BACKTITLE" \
|
|
|
|
|
--title "$TITLE" \
|
|
|
|
|
--ok-label "Select" \
|
|
|
|
|
--cancel-label "Back" \
|
|
|
|
|
--menu "$MENU" \
|
|
|
|
|
$HEIGHT $WIDTH $CHOICE_HEIGHT \
|
|
|
|
|
"${OPTIONS[@]}" \
|
|
|
|
|
2>&1 >/dev/tty)
|
2021-03-06 11:11:45 +00:00
|
|
|
|
|
|
|
|
case $CHOICE in
|
|
|
|
|
|
2021-05-06 20:37:40 +01:00
|
|
|
GEN)
|
|
|
|
|
menu_GEN;;
|
2021-03-06 11:11:45 +00:00
|
|
|
m0)
|
|
|
|
|
# wallet
|
2021-05-13 14:42:30 +01:00
|
|
|
chooseWallet noLockFileCheck
|
2021-03-06 11:11:45 +00:00
|
|
|
cacheAndShowQR
|
|
|
|
|
echo
|
|
|
|
|
echo "Press ENTER to return to the menu"
|
2022-03-06 13:41:40 +00:00
|
|
|
read key;;
|
2021-05-07 14:46:03 +01:00
|
|
|
DISPLAY)
|
|
|
|
|
menu_DISPLAY;;
|
2021-05-06 20:37:40 +01:00
|
|
|
MAKER)
|
|
|
|
|
menu_MAKER;;
|
2021-03-06 11:11:45 +00:00
|
|
|
DOCS)
|
|
|
|
|
datastring="https://github.com/openoms/joininbox#more-info"
|
|
|
|
|
clear
|
|
|
|
|
echo
|
|
|
|
|
echo "Find a collection of written documentation and links to videos at:"
|
|
|
|
|
echo "$datastring"
|
|
|
|
|
echo
|
|
|
|
|
qrencode -t ANSIUTF8 "${datastring}"
|
2022-03-06 13:41:40 +00:00
|
|
|
echo
|
2021-03-06 11:11:45 +00:00
|
|
|
echo "Press ENTER to return to the menu..."
|
2021-05-06 20:37:40 +01:00
|
|
|
read key;;
|
2021-03-06 11:11:45 +00:00
|
|
|
esac
|