2020-06-15 15:35:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# WALLET menu options
|
|
|
|
|
|
|
|
|
|
source /home/joinmarket/joinin.conf
|
2020-09-30 13:58:32 +01:00
|
|
|
source /home/joinmarket/_functions.sh
|
2020-06-15 15:35:18 +01:00
|
|
|
|
|
|
|
|
# BASIC MENU INFO
|
2020-10-14 09:39:28 +01:00
|
|
|
HEIGHT=11
|
2020-06-15 15:35:18 +01:00
|
|
|
WIDTH=52
|
|
|
|
|
CHOICE_HEIGHT=20
|
2020-10-14 09:39:28 +01:00
|
|
|
TITLE="Wallet management options"
|
|
|
|
|
BACKTITLE="Wallet management options"
|
|
|
|
|
MENU=""
|
2020-06-15 15:35:18 +01:00
|
|
|
OPTIONS=()
|
|
|
|
|
|
|
|
|
|
# Basic Options
|
|
|
|
|
OPTIONS+=(\
|
|
|
|
|
GEN "Generate a new wallet" \
|
|
|
|
|
HISTORY "Show all past transactions" \
|
|
|
|
|
IMPORT "Copy wallet(s) from a remote node"\
|
|
|
|
|
RECOVER "Restore a wallet from the seed" \
|
2020-08-15 15:11:38 +01:00
|
|
|
UNLOCK "Remove the lockfiles"
|
2020-06-15 15:35:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
CHOICE=$(dialog --clear \
|
|
|
|
|
--backtitle "$BACKTITLE" \
|
|
|
|
|
--title "$TITLE" \
|
|
|
|
|
--menu "$MENU" \
|
|
|
|
|
$HEIGHT $WIDTH $CHOICE_HEIGHT \
|
|
|
|
|
"${OPTIONS[@]}" \
|
|
|
|
|
2>&1 >/dev/tty)
|
|
|
|
|
|
|
|
|
|
case $CHOICE in
|
|
|
|
|
|
2020-06-21 01:03:29 +01:00
|
|
|
GEN)
|
|
|
|
|
clear
|
|
|
|
|
echo ""
|
|
|
|
|
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
|
2020-09-09 09:50:47 +01:00
|
|
|
if [ "${RPCoverTor}" = "on" ]; then
|
2020-06-21 01:03:29 +01:00
|
|
|
torify python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py generate
|
|
|
|
|
else
|
|
|
|
|
python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py generate
|
|
|
|
|
fi
|
2020-09-09 09:50:47 +01:00
|
|
|
echo ""
|
2020-06-21 01:03:29 +01:00
|
|
|
echo "Press ENTER to return to the menu"
|
|
|
|
|
read key
|
|
|
|
|
;;
|
|
|
|
|
HISTORY)
|
2020-06-22 15:15:28 +01:00
|
|
|
# wallet
|
|
|
|
|
chooseWallet
|
2021-01-04 01:49:33 +00:00
|
|
|
/home/joinmarket/start.script.sh wallet-tool $(cat $wallet) "history -v 4"
|
2020-06-21 01:03:29 +01:00
|
|
|
echo ""
|
|
|
|
|
echo "Press ENTER to return to the menu"
|
|
|
|
|
read key
|
|
|
|
|
;;
|
|
|
|
|
IMPORT)
|
|
|
|
|
/home/joinmarket/info.importwallet.sh
|
|
|
|
|
echo "Returning to the menu..."
|
2020-08-15 15:11:38 +01:00
|
|
|
sleep 1
|
2020-06-21 01:03:29 +01:00
|
|
|
/home/joinmarket/menu.sh
|
|
|
|
|
;;
|
|
|
|
|
RECOVER)
|
2020-06-22 20:51:26 +01:00
|
|
|
clear
|
2020-06-21 01:03:29 +01:00
|
|
|
echo ""
|
|
|
|
|
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
|
2020-09-09 09:50:47 +01:00
|
|
|
if [ "${RPCoverTor}" = "on" ];then
|
2020-06-21 01:03:29 +01:00
|
|
|
torify python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py recover
|
|
|
|
|
else
|
|
|
|
|
python /home/joinmarket/joinmarket-clientserver/scripts/wallet-tool.py recover
|
|
|
|
|
fi
|
2020-09-09 09:50:47 +01:00
|
|
|
echo ""
|
2020-06-21 01:03:29 +01:00
|
|
|
echo "Press ENTER to return to the menu"
|
|
|
|
|
read key
|
|
|
|
|
;;
|
2020-08-15 15:11:38 +01:00
|
|
|
UNLOCK)
|
|
|
|
|
echo "Removing the wallet lockfiles with the command:
|
2020-08-19 08:42:12 +01:00
|
|
|
rm ~/.joinmarket/wallets/.*.lock"
|
|
|
|
|
rm ~/.joinmarket/wallets/.*.lock
|
|
|
|
|
# for old version <v0.6.3
|
|
|
|
|
rm ~/.joinmarket/wallets/*.lock 2>/dev/null
|
2020-08-15 15:11:38 +01:00
|
|
|
echo ""
|
|
|
|
|
echo "Press ENTER to return to the menu"
|
|
|
|
|
read key
|
|
|
|
|
;;
|
2020-06-15 15:35:18 +01:00
|
|
|
esac
|