joininbox/scripts/menu.tools.sh

57 lines
1.2 KiB
Bash
Raw Normal View History

2020-12-14 20:04:37 +00:00
#!/bin/bash
source /home/joinmarket/joinin.conf
source /home/joinmarket/_functions.sh
function installBoltzmann {
if [ ! -f "/home/joinmarket/boltzmann/bvenv/bin/activate" ] ; then
cd /home/joinmarket/
git clone https://code.samourai.io/oxt/boltzmann.git
cd boltzmann
python3 -m venv bvenv
source bvenv/bin/activate || exit 1
python setup.py install
fi
}
function getTXID {
txid=$(mktemp 2>/dev/null)
dialog --backtitle "Enter a TXID" \
--title "Enter a TXID" \
--inputbox "
Paste a TXID to analyze" 9 71 2> "$txid"
openMenuIfCancelled $?
}
# BASIC MENU INFO
HEIGHT=7
WIDTH=54
2020-12-14 20:04:37 +00:00
CHOICE_HEIGHT=20
TITLE="Tools"
MENU=""
OPTIONS=()
BACKTITLE="JoininBox GUI"
# Basic Options
OPTIONS+=(\
2021-01-06 01:55:21 +00:00
BOLTZMANN "Analyze the entropy of a transaction"\
2020-12-14 20:04:37 +00:00
)
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
case $CHOICE in
BOLTZMANN)
2021-01-03 19:39:57 +00:00
installBoltzmann
getTXID
python /home/joinmarket/start.boltzmann.py --txid=$(cat $txid)
echo
echo "Press ENTER to return to the menu..."
read key
;;
2020-12-14 20:04:37 +00:00
esac