Cleanup old scripts

This commit is contained in:
rootzoll 2020-01-27 02:09:23 +01:00
parent 5d707f9a4a
commit 37ecec65de
4 changed files with 2 additions and 245 deletions

View File

@ -77,7 +77,7 @@ if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
fi
if [ "${runBehindTor}" == "on" ]; then
OPTIONS+=(TOR "Tor Service options")
OPTIONS+=(TOR "Monitor TOR Service")
fi
if [ "${touchscreen}" == "1" ]; then
@ -130,7 +130,7 @@ case $CHOICE in
./00mainMenu.sh
;;
TOR)
./00torMenu.sh
sudo -u bitcoin nyx
./00mainMenu.sh
;;
SCREEN)

View File

@ -1,142 +0,0 @@
#!/bin/bash
# get raspiblitz config
echo "get raspiblitz config"
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
# correct old Hidden Services for RTL and BTC-RPC-Explorer
if [ $(sudo cat /etc/tor/torrc | grep "HiddenServicePort 3000" -c) -eq 1 ]; then
torNeedsRestart=1
sudo sed -i "s/^HiddenServicePort 3000 127.0.0.1:3000/HiddenServicePort 80 127.0.0.1:3000/g" /etc/tor/torrc
elif [ $(sudo cat /etc/tor/torrc | grep "HiddenServicePort 3002" -c) -eq 1 ]; then
torNeedsRestart=1
sudo sed -i "s/^HiddenServicePort 3002 127.0.0.1:3002/HiddenServicePort 80 127.0.0.1:3002/g" /etc/tor/torrc
else
torNeedsRestart=0
fi
if [ $torNeedsRestart -eq 1 ]; then
sudo systemctl restart tor
echo "Restarting Tor after fixing Hidden Service ports"
sleep 5
fi
echo "Run dialog ..."
echo "Installing the QR code generator (qrencode)"
# Make sure needed packages are installed
if [ $(sudo dpkg-query -l | grep "ii fbi" | wc -l) = 0 ]; then
sudo apt-get install fbi -y > /dev/null
fi
if [ $(sudo dpkg-query -l | grep "ii qrencode" | wc -l) = 0 ]; then
sudo apt-get install qrencode -y > /dev/null
fi
# BASIC MENU INFO
HEIGHT=14
WIDTH=64
CHOICE_HEIGHT=7
BACKTITLE="RaspiBlitz"
TITLE=""
MENU="Choose one of the following options:"
OPTIONS=()
plus=""
# Basic Options
OPTIONS+=(NYX "Monitor TOR" \
ZEUS "Connect Zeus over Tor (Android)" \
ZAP "Connect Zap over Tor (iOS TestFlight)" \
NODED "Connect Fully Noded (iOS TestFlight)" )
if [ "${rtlWebinterface}" = "on" ]; then
OPTIONS+=(RTL "RTL web interface address")
fi
if [ "${BTCRPCexplorer}" = "on" ]; then
OPTIONS+=(EXPLORER "BTC-RPC-Explorer address")
fi
if [ "${ElectRS}" = "on" ]; then
OPTIONS+=(ELECTRS "Electrum Rust Server address")
fi
if [ "${BTCPayServer}" = "on" ]; then
OPTIONS+=(BTCPAY "BTCPay Server address")
fi
dialogcancel=$?
echo "done dialog"
clear
# check if user canceled dialog
echo "dialogcancel(${dialogcancel})"
if [ ${dialogcancel} -eq 1 ]; then
echo "user canceled"
exit 1
fi
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
#clear
case $CHOICE in
CLOSE)
exit 1;
;;
NYX)
sudo -u bitcoin nyx
./00mainMenu.sh
;;
ZEUS)
./97addMobileWalletTor.sh zeus
./00mainMenu.sh
;;
ZAP)
./97addMobileWalletTor.sh zap
./00mainMenu.sh
;;
NODED)
./97addMobileWalletFullyNoded.sh
./00mainMenu.sh
;;
RTL)
clear
./config.scripts/internet.hiddenservice.sh RTL 80 3000
./XXdisplayHiddenServiceQR.sh RTL
./00mainMenu.sh
;;
EXPLORER)
clear
./config.scripts/internet.hiddenservice.sh btc-rpc-explorer 80 3002
./XXdisplayHiddenServiceQR.sh btc-rpc-explorer
./00mainMenu.sh
;;
ELECTRS)
clear
./config.scripts/internet.hiddenservice.sh electrs 50002 50002 50001 50001
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/electrs/hostname)
echo ""
echo "The Tor Hidden Service address for electrs is:"
echo "$TOR_ADDRESS"
echo ""
echo "To connect the Electrumwallet through Tor open the Tor Browser and start Electrum with the options:"
echo "\`electrum --oneserver --server=$TOR_ADDRESS:50002:s --proxy socks5:127.0.0.1:9150\`"
echo ""
echo "See the docs for more detailed instructions to connect Electrum on Windows/Mac/Linux:"
echo "https://github.com/openoms/bitcoin-tutorials/tree/master/electrs#connect-the-electrum-wallet-to-electrs"
echo ""
echo "scan the QR to use the Tor address in Electrum on mobile:"
qrencode -t ANSI256 $TOR_ADDRESS
echo "Press ENTER to return to the menu"
read key
./00mainMenu.sh
;;
BTCPAY)
clear
./config.scripts/internet.hiddenservice.sh btcpay 80 23000
./XXdisplayHiddenServiceQR.sh btcpay
./00mainMenu.sh
;;
esac

View File

@ -1,86 +0,0 @@
#!/bin/bash
clear
# get wallet from argument
if [ $1 == zeus ]; then
echo "pairing Zeus"
elif [ $1 == zap ]; then
echo "pairing Zap"
else
echo "pair either Zap or Zeus"
fi
./config.scripts/internet.hiddenservice.sh lnd_REST 8080 8080
# make sure Go is installed
/home/admin/config.scripts/bonus.go.sh
# make sure lndconnect is installed
/home/admin/config.scripts/bonus.lndconnect.sh install
# get Go vars
source /etc/profile
if [ $1 == zeus ]; then
echo ""
echo "Set up on your mobile: "
echo "Zeus: https://zeusln.app/"
echo "Orbot: https://github.com/openoms/bitcoin-tutorials/blob/master/Zeus_to_RaspiBlitz_through_Tor.md#set-up-orbot"
elif [ $1 == zap ]; then
echo ""
echo "Download the Zap Mainnet Wallet from iOS Testflight:"
echo "https://zap.jackmallers.com/download/"
fi
echo ""
echo " ***WARNING***"
echo ""
echo "The QR code to allow connecting to your node remotely"
echo "will show on the RaspiBlitz LCD and/or your screen."
echo "Be aware of the windows, cameras, mirrors and bystanders!"
echo ""
echo "Press ENTER to continue, CTRL+C to cancel."
echo ""
read key
/home/admin/config.scripts/blitz.lcd.sh hide
cd /home/admin
# write QR code to image
if [ $1 == zeus ]; then
lndconnect --host=$(sudo cat /mnt/hdd/tor/lnd_REST/hostname) --port=8080 --image
elif [ $1 == zap ]; then
lndconnect --host=$(sudo cat /mnt/hdd/tor/lnd_REST/hostname) --port=8080 --nocert --image
fi
# display qr code image on LCD
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/lndconnect-qr.png
# show pairing info dialog
msg=""
msg="You should now see the pairing QR code on the RaspiBlitz LCD.\n\n${msg}When you start the App choose to connect to your own node.\n(DIY / Remote-Node / lndconnect)\n\nClick on the 'Scan QR' button. Scan the QR on the LCD and <continue> or <show QR code> to see it in this window."
whiptail --backtitle "Connecting Mobile Wallet" \
--title "Pairing by QR code" \
--yes-button "continue" \
--no-button "show QR code" \
--yesno "${msg}" 18 65
if [ $? -eq 1 ]; then
if [ $1 == zeus ]; then
lndconnect --host=$(sudo cat /mnt/hdd/tor/lnd_REST/hostname) --port=8080
elif [ $1 == zap ]; then
lndconnect --host=$(sudo cat /mnt/hdd/tor/lnd_REST/hostname) --port=8080 --nocert
fi
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished."
read key
fi
# clean up
/home/admin/config.scripts/blitz.lcd.sh hide
shred lndconnect-qr.png 2> /dev/null
rm -f lndconnect-qr.png 2> /dev/null
shred qr.txt 2> /dev/null
rm -f qr.txt 2> /dev/null
echo "------------------------------"
echo "If the connection was not working:"
echo "- try to refresh the TLS & macaroons: Main Menu 'EXPORT > 'RESET'"
echo "- check issues: https://github.com/LN-Zap/lndconnect/issues"
echo "- check issues: https://github.com/rootzoll/raspiblitz/issues"
echo ""

View File

@ -1,15 +0,0 @@
# display QR code for chosen Hidden Service
# use the HiddenServiceDir from /etc/tor/torrc as the $1 parameter
service=$1
hiddenService=$(sudo cat /mnt/hdd/tor/$service/hostname)
echo ""
echo "Download the Tor Browser to your desktop to open the .onion Hidden Service address:"
echo "https://www.torproject.org/download/"
echo ""
echo "The Hidden Service address for $service is:"
echo "$hiddenService"
echo ""
echo "scan the QR to use it in the Tor Browser on mobile:"
qrencode -t ANSI256 $hiddenService
echo "Press ENTER to return to the menu"
read key