mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 07:07:46 +01:00
90 lines
2.3 KiB
Bash
90 lines
2.3 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
# get basic system information
|
||
|
# these are the same set of infos the WebGUI dialog/controler has
|
||
|
source /home/admin/raspiblitz.info
|
||
|
|
||
|
# SETUPFILE
|
||
|
# this key/value file contains the state during the setup process
|
||
|
SETUPFILE="/var/cache/raspiblitz/temp/raspiblitz.setup"
|
||
|
source $SETUPFILE
|
||
|
|
||
|
|
||
|
#################################
|
||
|
# SELECT BLOCKCHAIN
|
||
|
# when not already set by setupfile
|
||
|
|
||
|
if [ "${network}" == "" ]; then
|
||
|
|
||
|
OPTIONS=()
|
||
|
OPTIONS+=(BITCOIN "Setup BITCOIN Blockchain (BitcoinCore)")
|
||
|
OPTIONS+=(LITECOIN "Setup LITECOIN Blockchain (experimental)")
|
||
|
CHOICE=$(dialog --clear \
|
||
|
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
|
||
|
--title "⚡ Blockchain ⚡" \
|
||
|
--menu "\nChoose which Blockchain to run: \n " \
|
||
|
11 64 5 \
|
||
|
"${OPTIONS[@]}" \
|
||
|
2>&1 >/dev/tty)
|
||
|
clear
|
||
|
case $CHOICE in
|
||
|
BITCOIN)
|
||
|
# bitcoin core
|
||
|
network="bitcoin"
|
||
|
;;
|
||
|
LITECOIN)
|
||
|
# litecoin
|
||
|
network="litecoin"
|
||
|
# can only work with LND
|
||
|
lightning="lnd"
|
||
|
;;
|
||
|
*)
|
||
|
clear
|
||
|
echo "User Cancel"
|
||
|
exit 1
|
||
|
esac
|
||
|
fi
|
||
|
|
||
|
|
||
|
#################################
|
||
|
# SELECT LIGHTNING
|
||
|
# only possible when network is bitcoin
|
||
|
|
||
|
if [ "${network}" == "bitcoin" ]; then
|
||
|
|
||
|
# choose lightning client
|
||
|
OPTIONS=()
|
||
|
OPTIONS+=(LND "LND - Lightning Network Daemon (DEFAULT)")
|
||
|
OPTIONS+=(CLN "C-lightning by Blockstream (fewer apps)")
|
||
|
OPTIONS+=(NONE "Run without Lightning")
|
||
|
CHOICE=$(dialog --clear \
|
||
|
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
|
||
|
--title "⚡ Lightning ⚡" \
|
||
|
--menu "\nChoose your Lightning Client: \n " \
|
||
|
12 64 6 \
|
||
|
"${OPTIONS[@]}" \
|
||
|
2>&1 >/dev/tty)
|
||
|
clear
|
||
|
case $CHOICE in
|
||
|
LND)
|
||
|
lightning="lnd"
|
||
|
;;
|
||
|
CLN)
|
||
|
lightning="cln"
|
||
|
;;
|
||
|
NONE)
|
||
|
lightning="none"
|
||
|
;;
|
||
|
*)
|
||
|
clear
|
||
|
echo "User Cancel"
|
||
|
exit 1
|
||
|
esac
|
||
|
fi
|
||
|
|
||
|
# write results to setup sate
|
||
|
echo "lightning=${lightning}" >> $SETUPFILE
|
||
|
echo "network=${network}" >> $SETUPFILE
|
||
|
echo "chain=main" >> $SETUPFILE
|
||
|
|
||
|
exit 0
|