2018-12-06 17:39:06 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-01-13 19:44:13 +01:00
|
|
|
|
# check if run by root user
|
2021-12-14 23:34:35 +01:00
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
|
echo "error='run as root'"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2022-12-09 21:49:44 +01:00
|
|
|
|
|
2018-12-06 17:39:06 +01:00
|
|
|
|
# This script gets called from a fresh SD card
|
|
|
|
|
# starting up that has an config file on HDD
|
|
|
|
|
# from old RaspiBlitz or manufacturer to
|
2019-09-22 15:34:03 +02:00
|
|
|
|
# to install and config services
|
2018-12-06 17:39:06 +01:00
|
|
|
|
|
|
|
|
|
# LOGFILE - store debug logs of bootstrap
|
|
|
|
|
logFile="/home/admin/raspiblitz.log"
|
|
|
|
|
|
|
|
|
|
# INFOFILE - state data from bootstrap
|
|
|
|
|
infoFile="/home/admin/raspiblitz.info"
|
|
|
|
|
|
|
|
|
|
# CONFIGFILE - configuration of RaspiBlitz
|
|
|
|
|
configFile="/mnt/hdd/raspiblitz.conf"
|
|
|
|
|
|
2021-09-09 01:19:09 +02:00
|
|
|
|
# SETUPFILE
|
|
|
|
|
# this key/value file contains the state during the setup process
|
|
|
|
|
setupFile="/var/cache/raspiblitz/temp/raspiblitz.setup"
|
|
|
|
|
source ${setupFile}
|
|
|
|
|
|
2021-08-04 00:18:30 +02:00
|
|
|
|
# log header
|
|
|
|
|
echo "" >> ${logFile}
|
|
|
|
|
echo "###################################" >> ${logFile}
|
|
|
|
|
echo "# _provision_.sh" >> ${logFile}
|
|
|
|
|
echo "###################################" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Provisioning from Config"
|
2018-12-06 17:39:06 +01:00
|
|
|
|
|
|
|
|
|
# check if there is a config file
|
|
|
|
|
configExists=$(ls ${configFile} 2>/dev/null | grep -c '.conf')
|
|
|
|
|
if [ ${configExists} -eq 0 ]; then
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.error.sh _provision_.sh "missing-config" "no config file (${configFile}) found to run provision" "" ${logFile}
|
2018-12-06 17:39:06 +01:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2018-12-12 15:29:38 +01:00
|
|
|
|
# import config values
|
2018-12-12 16:12:56 +01:00
|
|
|
|
source ${configFile}
|
2018-12-12 15:29:38 +01:00
|
|
|
|
|
2018-12-06 17:39:06 +01:00
|
|
|
|
##########################
|
|
|
|
|
# BASIC SYSTEM SETTINGS
|
|
|
|
|
##########################
|
|
|
|
|
|
|
|
|
|
echo "### BASIC SYSTEM SETTINGS ###" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup System ."
|
2018-12-06 17:39:06 +01:00
|
|
|
|
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "# Make sure the user bitcoin is in the debian-tor group"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
usermod -a -G debian-tor bitcoin
|
2021-08-04 00:18:30 +02:00
|
|
|
|
|
2022-05-17 18:48:33 +02:00
|
|
|
|
echo "# Optimizing log files: rotate daily, keep 1 week & compress old days " >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/^weekly/daily/g" /etc/logrotate.conf >> ${logFile} 2>&1
|
2022-05-17 18:48:33 +02:00
|
|
|
|
sed -i "s/^rotate 4/rotate 7/g" /etc/logrotate.conf >> ${logFile} 2>&1
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/^#compress/compress/g" /etc/logrotate.conf >> ${logFile} 2>&1
|
|
|
|
|
systemctl restart logrotate
|
2021-09-23 12:27:12 +02:00
|
|
|
|
|
2021-09-23 13:59:55 +02:00
|
|
|
|
# make sure to have bitcoin core >=22 is backwards comp
|
|
|
|
|
# see https://github.com/rootzoll/raspiblitz/issues/2546
|
|
|
|
|
sed -i '/^deprecatedrpc=.*/d' /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null
|
|
|
|
|
echo "deprecatedrpc=addresses" >> /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null
|
|
|
|
|
|
2021-08-20 12:27:07 +02:00
|
|
|
|
# backup SSH PubKeys
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.ssh.sh backup
|
2019-01-15 02:37:14 +01:00
|
|
|
|
|
2022-05-17 16:18:30 +02:00
|
|
|
|
# optimize mempool if RAM >1GB
|
2019-07-28 23:26:14 +02:00
|
|
|
|
kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g')
|
|
|
|
|
if [ ${kbSizeRAM} -gt 1500000 ]; then
|
|
|
|
|
echo "Detected RAM >1GB --> optimizing ${network}.conf"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf
|
2019-07-28 23:26:14 +02:00
|
|
|
|
fi
|
2020-10-30 12:20:55 +01:00
|
|
|
|
if [ ${kbSizeRAM} -gt 3500000 ]; then
|
|
|
|
|
echo "Detected RAM >3GB --> optimizing ${network}.conf"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf
|
2020-10-30 12:20:55 +01:00
|
|
|
|
fi
|
2019-07-28 23:26:14 +02:00
|
|
|
|
|
2022-05-17 16:18:30 +02:00
|
|
|
|
# zram on for all devices
|
|
|
|
|
/home/admin/config.scripts/blitz.zram.sh on
|
|
|
|
|
|
2019-12-12 14:51:21 +01:00
|
|
|
|
# link and copy HDD content into new OS on sd card
|
2018-12-06 17:39:06 +01:00
|
|
|
|
echo "Copy HDD content for user admin" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
mkdir /home/admin/.${network} >> ${logFile} 2>&1
|
|
|
|
|
cp /mnt/hdd/${network}/${network}.conf /home/admin/.${network}/${network}.conf >> ${logFile} 2>&1
|
|
|
|
|
mkdir /home/admin/.lnd >> ${logFile} 2>&1
|
|
|
|
|
cp /mnt/hdd/lnd/lnd.conf /home/admin/.lnd/lnd.conf >> ${logFile} 2>&1
|
|
|
|
|
cp /mnt/hdd/lnd/tls.cert /home/admin/.lnd/tls.cert >> ${logFile} 2>&1
|
|
|
|
|
mkdir /home/admin/.lnd/data >> ${logFile} 2>&1
|
|
|
|
|
cp -r /mnt/hdd/lnd/data/chain /home/admin/.lnd/data/chain >> ${logFile} 2>&1
|
|
|
|
|
chown -R admin:admin /home/admin/.${network} >> ${logFile} 2>&1
|
|
|
|
|
chown -R admin:admin /home/admin/.lnd >> ${logFile} 2>&1
|
|
|
|
|
cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service >> ${logFile} 2>&1
|
|
|
|
|
cp /home/admin/assets/tmux.conf.local /mnt/hdd/.tmux.conf.local >> ${logFile} 2>&1
|
|
|
|
|
chown admin:admin /mnt/hdd/.tmux.conf.local >> ${logFile} 2>&1
|
|
|
|
|
ln -s -f /mnt/hdd/.tmux.conf.local /home/admin/.tmux.conf.local >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
|
2021-08-27 13:41:32 +02:00
|
|
|
|
|
|
|
|
|
# PREPARE LND (if activated)
|
|
|
|
|
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
2021-12-09 19:00:57 +01:00
|
|
|
|
# backup LND TLS certs
|
2021-08-27 13:41:32 +02:00
|
|
|
|
# https://github.com/rootzoll/raspiblitz/issues/324
|
2021-12-09 19:00:57 +01:00
|
|
|
|
echo "*** Make backup of LND TLS files" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
rm -r /var/cache/raspiblitz/tls_backup 2>/dev/null
|
|
|
|
|
mkdir /var/cache/raspiblitz/tls_backup 2>/dev/null
|
|
|
|
|
cp /mnt/hdd/lnd/tls.cert /var/cache/raspiblitz/tls_backup/tls.cert >> ${logFile} 2>&1
|
|
|
|
|
cp /mnt/hdd/lnd/tls.key /var/cache/raspiblitz/tls_backup/tls.key >> ${logFile} 2>&1
|
2019-04-02 22:00:39 +02:00
|
|
|
|
fi
|
|
|
|
|
echo "" >> ${logFile}
|
|
|
|
|
|
2021-08-04 00:18:30 +02:00
|
|
|
|
##########################
|
|
|
|
|
# FINISH SETUP
|
|
|
|
|
##########################
|
|
|
|
|
|
2018-12-06 17:39:06 +01:00
|
|
|
|
# finish setup (SWAP, Benus, Firewall, Update, ..)
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup System .."
|
2021-08-04 00:18:30 +02:00
|
|
|
|
|
|
|
|
|
# add bonus scripts (auto install deactivated to reduce third party repos)
|
|
|
|
|
mkdir /home/admin/tmpScriptDL
|
|
|
|
|
cd /home/admin/tmpScriptDL
|
|
|
|
|
echo "installing bash completion for bitcoin-cli and lncli"
|
|
|
|
|
wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/bitcoin-cli.bash-completion
|
|
|
|
|
wget https://raw.githubusercontent.com/lightningnetwork/lnd/master/contrib/lncli.bash-completion
|
2022-01-13 19:44:13 +01:00
|
|
|
|
cp *.bash-completion /etc/bash_completion.d/
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "OK - bash completion available after next login"
|
|
|
|
|
echo "type \"bitcoin-cli getblockch\", press [Tab] → bitcoin-cli getblockchaininfo"
|
|
|
|
|
rm -r /home/admin/tmpScriptDL
|
|
|
|
|
cd
|
|
|
|
|
|
|
|
|
|
###### SWAP File
|
2022-01-13 19:44:13 +01:00
|
|
|
|
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
2021-08-04 00:18:30 +02:00
|
|
|
|
if [ ${isSwapExternal} -eq 0 ]; then
|
|
|
|
|
echo "No external SWAP found - creating ... "
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.datadrive.sh swap on
|
2021-08-04 00:18:30 +02:00
|
|
|
|
else
|
|
|
|
|
echo "SWAP already OK"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
####### FIREWALL - just install (not configure)
|
|
|
|
|
echo ""
|
|
|
|
|
echo "*** Setting and Activating Firewall ***"
|
|
|
|
|
echo "deny incoming connection on other ports"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw default deny incoming
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow outgoing connections"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw default allow outgoing
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: ssh"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow ssh
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: bitcoin testnet"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 18333 comment 'bitcoin testnet'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: bitcoin mainnet"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 8333 comment 'bitcoin mainnet'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo 'allow: lightning testnet'
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 19735 comment 'lightning testnet'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: lightning mainnet"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 9735 comment 'lightning mainnet'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: lightning gRPC"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 10009 comment 'lightning gRPC'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: lightning REST API"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow 8080 comment 'lightning REST API'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: public web HTTP"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow from any to any port 80 comment 'allow public web HTTP'
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "allow: local web admin HTTPS"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow from 10.0.0.0/8 to any port 443 comment 'allow local LAN HTTPS'
|
|
|
|
|
ufw allow from 172.16.0.0/12 to any port 443 comment 'allow local LAN HTTPS'
|
|
|
|
|
ufw allow from 192.168.0.0/16 to any port 443 comment 'allow local LAN HTTPS'
|
2022-12-14 10:55:33 +01:00
|
|
|
|
echo "open firewall for auto nat discover (see issue #129 & #3144)"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw allow proto udp from 10.0.0.0/8 port 1900 to any comment 'allow local LAN SSDP for UPnP discovery'
|
|
|
|
|
ufw allow proto udp from 172.16.0.0/12 port 1900 to any comment 'allow local LAN SSDP for UPnP discovery'
|
|
|
|
|
ufw allow proto udp from 192.168.0.0/16 port 1900 to any comment 'allow local LAN SSDP for UPnP discovery'
|
2022-12-14 10:55:33 +01:00
|
|
|
|
ufw allow proto udp from 192.168.0.0/16 port 5350 to any comment 'Bonjour NAT'
|
|
|
|
|
ufw allow proto udp from 172.16.0.0/12 port 5350 to any comment 'Bonjour NAT'
|
|
|
|
|
ufw allow proto udp from 192.168.0.0/16 port 5351 to any comment 'Bonjour NAT'
|
|
|
|
|
ufw allow proto udp from 172.16.0.0/12 port 5351 to any comment 'Bonjour NAT'
|
|
|
|
|
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "enable lazy firewall"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
ufw --force enable
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
# update system
|
|
|
|
|
echo ""
|
|
|
|
|
echo "*** Update System ***"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
apt-mark hold raspberrypi-bootloader
|
|
|
|
|
apt-get update -y
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "OK - System is now up to date"
|
|
|
|
|
|
|
|
|
|
# mark setup is done
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info
|
2018-12-06 17:39:06 +01:00
|
|
|
|
|
|
|
|
|
##########################
|
|
|
|
|
# PROVISIONING SERVICES
|
|
|
|
|
##########################
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Installing Services"
|
2018-12-06 17:39:06 +01:00
|
|
|
|
|
2020-06-10 22:51:32 +02:00
|
|
|
|
# BLITZ WEB SERVICE
|
|
|
|
|
echo "Provisioning BLITZ WEB SERVICE - run config script" >> ${logFile}
|
2022-05-05 10:59:50 +02:00
|
|
|
|
/home/admin/config.scripts/blitz.web.sh https-on >> ${logFile} 2>&1
|
|
|
|
|
|
|
|
|
|
echo "### RUNNING PROVISIONING SERVICES ###" >> ${logFile}
|
2020-06-10 22:51:32 +02:00
|
|
|
|
|
2021-04-19 16:46:44 +02:00
|
|
|
|
# BITCOIN INTERIMS UPDATE
|
|
|
|
|
if [ ${#bitcoinInterimsUpdate} -gt 0 ]; then
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Provisioning Bitcoin Core update"
|
2021-04-19 16:46:44 +02:00
|
|
|
|
if [ "${bitcoinInterimsUpdate}" == "reckless" ]; then
|
|
|
|
|
# recklessly update Bitcoin Core to latest release on GitHub
|
2021-08-27 09:59:21 +02:00
|
|
|
|
echo "Provisioning Bitcoin Core reckless interims update" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bitcoin.update.sh reckless >> ${logFile}
|
2021-04-19 16:46:44 +02:00
|
|
|
|
else
|
|
|
|
|
# when installing the same sd image - this will re-trigger the secure interims update
|
|
|
|
|
# if this a update with a newer RaspiBlitz version .. interims update will be ignored
|
|
|
|
|
# because standard Bitcoin Core version is most more up to date
|
2021-12-14 23:34:35 +01:00
|
|
|
|
echo "Provisioning Bitcoin Core tested interims update" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bitcoin.update.sh tested ${bitcoinInterimsUpdate} >> ${logFile}
|
2021-04-19 16:46:44 +02:00
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Bitcoin Core interims update - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-12-07 20:26:10 +01:00
|
|
|
|
# I2P
|
|
|
|
|
echo "Start i2pd" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "i2pd setup"
|
|
|
|
|
/home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile}
|
|
|
|
|
|
2020-04-26 01:45:39 +02:00
|
|
|
|
# LND INTERIMS UPDATE
|
|
|
|
|
if [ ${#lndInterimsUpdate} -gt 0 ]; then
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Provisioning LND update"
|
2020-04-26 03:14:02 +02:00
|
|
|
|
if [ "${lndInterimsUpdate}" == "reckless" ]; then
|
2020-04-26 01:45:39 +02:00
|
|
|
|
# recklessly update LND to latest release on GitHub (just for test & dev nodes)
|
|
|
|
|
echo "Provisioning LND reckless interims update" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.update.sh reckless >> ${logFile}
|
2020-04-26 01:45:39 +02:00
|
|
|
|
else
|
|
|
|
|
# when installing the same sd image - this will re-trigger the secure interims update
|
|
|
|
|
# if this a update with a newer RaspiBlitz version .. interims update will be ignored
|
|
|
|
|
# because standard LND version is most more up to date
|
2020-09-15 16:32:58 +02:00
|
|
|
|
echo "Provisioning LND verified interims update" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.update.sh verified ${lndInterimsUpdate} >> ${logFile}
|
2020-04-26 01:45:39 +02:00
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LND interims update - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-09-28 00:34:49 +02:00
|
|
|
|
# CL INTERIMS UPDATE
|
|
|
|
|
if [ ${#clInterimsUpdate} -gt 0 ]; then
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Provisioning CL update"
|
2021-09-28 00:34:49 +02:00
|
|
|
|
if [ "${clInterimsUpdate}" == "reckless" ]; then
|
2023-05-16 13:12:36 +02:00
|
|
|
|
# determine the database version # Examples: 216 is CLN v23.02.2 # 219 is CLN v23.05
|
|
|
|
|
clDbVersion=$(sqlite3 /mnt/hdd/app-data/.lightning/bitcoin/lightningd.sqlite3 "SELECT version FROM version;")
|
|
|
|
|
if [ ${#clDbVersion} -eq 0 ]; then
|
|
|
|
|
echo "Could not determine the CLN database version - using 0" >> ${logFile}
|
|
|
|
|
clDbVersion=0
|
|
|
|
|
else
|
|
|
|
|
echo "The CLN database version is ${clDbVersion}" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
if [ ${clDbVersion} -lt 217 ]; then
|
|
|
|
|
# even if reckless is set - update to the recommended release
|
|
|
|
|
echo "Provisioning CL verified interims update" >> ${logFile}
|
|
|
|
|
/home/admin/config.scripts/cl.update.sh verified >> ${logFile}
|
|
|
|
|
else # 217 or higher
|
|
|
|
|
# recklessly update CL to latest release on GitHub (just for test & dev nodes)
|
|
|
|
|
echo "Provisioning CL reckless interims update" >> ${logFile}
|
|
|
|
|
/home/admin/config.scripts/cl.update.sh reckless >> ${logFile}
|
|
|
|
|
fi
|
2021-09-28 00:34:49 +02:00
|
|
|
|
else
|
|
|
|
|
# when installing the same sd image - this will re-trigger the secure interims update
|
2023-05-16 13:12:36 +02:00
|
|
|
|
# if this is an update with a newer RaspiBlitz version .. interims update will be ignored
|
|
|
|
|
# because the standard CL version is up to date
|
2021-09-28 00:34:49 +02:00
|
|
|
|
echo "Provisioning CL verified interims update" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/cl.update.sh verified ${clInterimsUpdate} >> ${logFile}
|
2021-09-28 00:34:49 +02:00
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning CL interims update - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-08-29 10:43:23 +02:00
|
|
|
|
# Bitcoin Testnet
|
|
|
|
|
if [ "${testnet}" == "on" ]; then
|
|
|
|
|
echo "Provisioning ${network} Testnet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bitcoin.install.sh on testnet >> ${logFile} 2>&1
|
|
|
|
|
systemctl start tbitcoind >> ${logFile} 2>&1
|
2021-08-29 10:43:23 +02:00
|
|
|
|
else
|
2021-09-12 19:38:30 +02:00
|
|
|
|
echo "Provisioning ${network} Testnet - not active" >> ${logFile}
|
2021-08-29 10:43:23 +02:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Bitcoin Signet
|
|
|
|
|
if [ "${signet}" == "on" ]; then
|
|
|
|
|
echo "Provisioning ${network} Signet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bitcoin.install.sh on signet >> ${logFile} 2>&1
|
|
|
|
|
systemctl start sbitcoind >> ${logFile} 2>&1
|
2021-08-29 10:43:23 +02:00
|
|
|
|
else
|
2021-09-12 19:38:30 +02:00
|
|
|
|
echo "Provisioning ${network} Signet - not active" >> ${logFile}
|
2021-08-29 10:43:23 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2022-01-13 19:44:13 +01:00
|
|
|
|
# LND binary install
|
|
|
|
|
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ] || [ "${tlnd}" == "on" ] || [ "${slnd}" == "on" ]; then
|
|
|
|
|
# if already installed by fatpack will skip
|
|
|
|
|
echo "Provisioning LND Binary - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/config.scripts/lnd.install.sh install >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LND Binary - not active" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-08-29 11:26:35 +02:00
|
|
|
|
# LND Mainnet (when not main instance)
|
|
|
|
|
if [ "${lnd}" == "on" ] && [ "${lightning}" != "lnd" ]; then
|
|
|
|
|
echo "Provisioning LND Mainnet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.install.sh on mainnet >> ${logFile} 2>&1
|
2021-08-29 11:26:35 +02:00
|
|
|
|
else
|
2021-09-12 19:38:30 +02:00
|
|
|
|
echo "Provisioning LND Mainnet - not active as secondary option" >> ${logFile}
|
2021-08-29 11:26:35 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2021-08-28 16:41:51 +02:00
|
|
|
|
# LND Testnet
|
|
|
|
|
if [ "${tlnd}" == "on" ]; then
|
|
|
|
|
echo "Provisioning LND Testnet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.install.sh on testnet >> ${logFile} 2>&1
|
|
|
|
|
systemctl start tlnd >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2021-09-12 19:38:30 +02:00
|
|
|
|
echo "Provisioning LND Testnet - not active" >> ${logFile}
|
2021-09-29 14:11:50 +02:00
|
|
|
|
fi
|
2021-08-28 16:41:51 +02:00
|
|
|
|
|
2021-09-30 10:56:52 +02:00
|
|
|
|
# LND Signet
|
2021-08-28 16:41:51 +02:00
|
|
|
|
if [ "${slnd}" == "on" ]; then
|
|
|
|
|
echo "Provisioning LND Signet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.install.sh on signet >> ${logFile} 2>&1
|
|
|
|
|
systemctl start slnd >> ${logFile} 2>&1
|
2021-08-28 16:41:51 +02:00
|
|
|
|
else
|
2021-09-29 14:11:50 +02:00
|
|
|
|
echo "Provisioning LND Signet - not active" >> ${logFile}
|
2018-12-06 17:39:06 +01:00
|
|
|
|
fi
|
2021-09-29 14:11:50 +02:00
|
|
|
|
|
2022-06-15 18:38:25 +02:00
|
|
|
|
# CORE LIGHTNING binary install
|
2022-02-05 17:13:11 +01:00
|
|
|
|
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${tcl}" == "on" ] || [ "${scl}" == "on" ]; then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
# if already installed by fatpack will skip
|
2022-07-27 08:29:16 +02:00
|
|
|
|
echo "Provisioning Core Lightning Binary - run config script" >> ${logFile}
|
2022-02-05 17:13:11 +01:00
|
|
|
|
/home/admin/config.scripts/cl.install.sh install >> ${logFile} 2>&1
|
2022-01-13 19:44:13 +01:00
|
|
|
|
else
|
2022-07-27 08:29:16 +02:00
|
|
|
|
echo "Provisioning Core Lightning Binary - not active" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2022-06-15 18:38:25 +02:00
|
|
|
|
# CL Mainnet
|
|
|
|
|
if [ "${cl}" == "on" ]; then
|
2021-09-26 11:30:09 +02:00
|
|
|
|
echo "Provisioning CL Mainnet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile} 2>&1
|
2021-08-29 11:26:35 +02:00
|
|
|
|
else
|
2022-06-15 18:38:25 +02:00
|
|
|
|
echo "Provisioning CL Mainnet - not active" >> ${logFile}
|
2021-08-29 11:26:35 +02:00
|
|
|
|
fi
|
2021-09-29 14:11:50 +02:00
|
|
|
|
|
2021-09-27 11:39:36 +02:00
|
|
|
|
# CL Testnet
|
2021-09-26 11:30:09 +02:00
|
|
|
|
if [ "${tcl}" == "on" ]; then
|
|
|
|
|
echo "Provisioning CL Testnet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/cl.install.sh on testnet >> ${logFile} 2>&1
|
2021-08-29 10:43:23 +02:00
|
|
|
|
else
|
2021-09-27 11:39:36 +02:00
|
|
|
|
echo "Provisioning CL Testnet - not active" >> ${logFile}
|
2021-08-29 10:43:23 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2021-09-27 11:39:36 +02:00
|
|
|
|
# CL Signet
|
2021-09-26 11:30:09 +02:00
|
|
|
|
if [ "${scl}" == "on" ]; then
|
2021-09-27 11:39:36 +02:00
|
|
|
|
echo "Provisioning CL Signet - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/cl.install.sh on signet >> ${logFile} 2>&1
|
2021-08-29 10:43:23 +02:00
|
|
|
|
else
|
2021-09-27 11:39:36 +02:00
|
|
|
|
echo "Provisioning CL Signet - not active" >> ${logFile}
|
2021-08-29 10:43:23 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2023-05-10 13:20:40 +02:00
|
|
|
|
|
2019-06-12 23:40:56 +02:00
|
|
|
|
# TOR
|
2021-08-04 00:18:30 +02:00
|
|
|
|
if [ "${runBehindTor}" == "on" ]; then
|
2019-06-12 23:40:56 +02:00
|
|
|
|
echo "Provisioning TOR - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Tor (takes time)"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/tor.network.sh on >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2021-12-14 23:34:35 +01:00
|
|
|
|
echo "Provisioning Tor - keep default" >> ${logFile}
|
2019-06-12 23:40:56 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2022-06-30 01:13:09 +02:00
|
|
|
|
# WebAPI & UI (in case image was not fatpack - but webapi was switchen on)
|
|
|
|
|
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
|
|
|
|
|
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
|
|
|
|
|
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
|
2022-12-22 00:38:44 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
|
|
|
|
|
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
|
2022-06-30 01:13:09 +02:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2018-12-06 17:39:06 +01:00
|
|
|
|
# AUTO PILOT
|
|
|
|
|
if [ "${autoPilot}" = "on" ]; then
|
|
|
|
|
echo "Provisioning AUTO PILOT - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup AutoPilot"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.autopilot.sh on >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2018-12-06 17:39:06 +01:00
|
|
|
|
echo "Provisioning AUTO PILOT - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-06-13 18:03:17 +02:00
|
|
|
|
# NETWORK UPNP
|
|
|
|
|
if [ "${networkUPnP}" = "on" ]; then
|
|
|
|
|
echo "Provisioning NETWORK UPnP - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup UPnP"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/network.upnp.sh on >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2019-06-13 18:03:17 +02:00
|
|
|
|
echo "Provisioning NETWORK UPnP - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-09-23 14:00:50 +02:00
|
|
|
|
# DYNAMIC DOMAIN
|
2018-12-20 14:13:42 +01:00
|
|
|
|
if [ "${#dynDomain}" -gt 0 ]; then
|
2020-09-23 14:00:50 +02:00
|
|
|
|
echo "Provisioning DYNAMIC DOMAIN - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup DynamicDomain"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/internet.dyndomain.sh on ${dynDomain} ${dynUpdateUrl} >> ${logFile} 2>&1
|
2018-12-20 14:13:42 +01:00
|
|
|
|
else
|
2020-09-23 14:00:50 +02:00
|
|
|
|
echo "Provisioning DYNAMIC DOMAIN - keep default" >> ${logFile}
|
2021-09-29 15:28:52 +02:00
|
|
|
|
fi
|
2018-12-20 14:13:42 +01:00
|
|
|
|
|
2021-09-30 10:56:52 +02:00
|
|
|
|
# RTL (LND)
|
2018-12-06 17:39:06 +01:00
|
|
|
|
if [ "${rtlWebinterface}" = "on" ]; then
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "Provisioning RTL LND - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup RTL LND (takes time)"
|
2021-09-30 10:56:52 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.rtl.sh on lnd mainnet >> ${logFile} 2>&1
|
2018-12-12 18:21:01 +01:00
|
|
|
|
else
|
2021-08-04 00:18:30 +02:00
|
|
|
|
echo "Provisioning RTL LND - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-09-27 11:46:30 +02:00
|
|
|
|
# RTL (CL)
|
2021-08-04 00:18:30 +02:00
|
|
|
|
if [ "${crtlWebinterface}" = "on" ]; then
|
2021-09-27 11:39:36 +02:00
|
|
|
|
echo "Provisioning RTL CL - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup RTL CL (takes time)"
|
2021-09-30 10:56:52 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.rtl.sh on cl mainnet >> ${logFile} 2>&1
|
2021-08-04 00:18:30 +02:00
|
|
|
|
else
|
2021-09-27 11:39:36 +02:00
|
|
|
|
echo "Provisioning RTL CL - keep default" >> ${logFile}
|
2021-08-04 00:18:30 +02:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# SPARKO
|
|
|
|
|
if [ "${sparko}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Sparko - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup SPARKO"
|
2021-09-26 11:30:09 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/cl-plugin.sparko.sh on mainnet >> ${logFile} 2>&1
|
2021-08-04 00:18:30 +02:00
|
|
|
|
else
|
2021-10-01 13:14:42 +02:00
|
|
|
|
echo "Provisioning Sparko - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-10-08 17:12:43 +02:00
|
|
|
|
# clHTTPplugin
|
|
|
|
|
if [ "${clHTTPplugin}" = "on" ]; then
|
|
|
|
|
echo "Provisioning clHTTPplugin - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup clHTTPplugin"
|
2021-10-08 17:12:43 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/cl-plugin.http.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning clHTTPplugin - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-12-08 12:56:30 +01:00
|
|
|
|
# clboss
|
|
|
|
|
if [ "${clboss}" = "on" ]; then
|
|
|
|
|
echo "Provisioning clboss - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup clboss"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/cl-plugin.clboss.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning clboss - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# clWatchtowerClient
|
|
|
|
|
if [ "${clWatchtowerClient}" = "on" ]; then
|
|
|
|
|
echo "Provisioning clWatchtowerClient - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup clWatchtowerClient"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/cl-plugin.watchtower-client.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning clWatchtowerClient - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-10-01 13:14:42 +02:00
|
|
|
|
# SPARK
|
|
|
|
|
if [ "${spark}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Spark Wallet - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup SPARK WALLET"
|
2021-10-01 13:14:42 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/cl.spark.sh on mainnet >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Spark Wallet - keep default" >> ${logFile}
|
2018-12-06 17:39:06 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2021-08-29 13:29:45 +02:00
|
|
|
|
#LOOP - install only if LiT won't be installed
|
|
|
|
|
if [ "${loop}" = "on" ] && [ "${lit}" != "on" ]; then
|
2019-12-18 13:26:49 +01:00
|
|
|
|
echo "Provisioning Lightning Loop - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Lightning Loop"
|
2019-12-25 01:23:34 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.loop.sh on >> ${logFile} 2>&1
|
2019-12-18 13:26:49 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Lightning Loop - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#BTC RPC EXPLORER
|
|
|
|
|
if [ "${BTCRPCexplorer}" = "on" ]; then
|
|
|
|
|
echo "Provisioning BTCRPCexplorer - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup BTCRPCexplorer (takes time)"
|
2019-12-25 01:23:34 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.btc-rpc-explorer.sh on >> ${logFile} 2>&1
|
2019-12-18 13:26:49 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning BTCRPCexplorer - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#ELECTRS
|
|
|
|
|
if [ "${ElectRS}" = "on" ]; then
|
|
|
|
|
echo "Provisioning ElectRS - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup ElectRS (takes time)"
|
2019-12-25 01:23:34 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.electrs.sh on >> ${logFile} 2>&1
|
2019-12-18 13:26:49 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning ElectRS - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-12-14 23:34:35 +01:00
|
|
|
|
# BTCPAYSERVER
|
2019-12-18 13:26:49 +01:00
|
|
|
|
if [ "${BTCPayServer}" = "on" ]; then
|
2020-07-18 03:05:08 +02:00
|
|
|
|
|
2020-07-18 20:18:54 +02:00
|
|
|
|
echo "Provisioning BTCPAYSERVER on TOR - running setup" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup BTCPay (takes time)"
|
2020-07-18 20:18:54 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.btcpayserver.sh on >> ${logFile} 2>&1
|
2021-12-14 23:34:35 +01:00
|
|
|
|
|
2019-12-18 13:26:49 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning BTCPayServer - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-03-22 22:10:54 +01:00
|
|
|
|
# deprecated - see: #2031
|
2019-12-18 13:26:49 +01:00
|
|
|
|
# LNDMANAGE
|
2021-03-22 22:10:54 +01:00
|
|
|
|
#if [ "${lndmanage}" = "on" ]; then
|
|
|
|
|
# echo "Provisioning lndmanage - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
# /home/admin/_cache.sh set message "Setup lndmanage"
|
2021-03-22 22:10:54 +01:00
|
|
|
|
# sudo -u admin /home/admin/config.scripts/bonus.lndmanage.sh on >> ${logFile} 2>&1
|
|
|
|
|
#else
|
|
|
|
|
# echo "Provisioning lndmanage - not active" >> ${logFile}
|
|
|
|
|
#fi
|
2019-12-18 13:26:49 +01:00
|
|
|
|
|
2019-03-17 16:11:28 +01:00
|
|
|
|
# CUSTOM PORT
|
|
|
|
|
echo "Provisioning LND Port" >> ${logFile}
|
2019-04-03 05:37:46 +02:00
|
|
|
|
if [ ${#lndPort} -eq 0 ]; then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
lndPort=$(cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':')
|
2019-04-03 05:37:46 +02:00
|
|
|
|
fi
|
2019-03-17 16:11:28 +01:00
|
|
|
|
if [ ${#lndPort} -gt 0 ]; then
|
|
|
|
|
if [ "${lndPort}" != "9735" ]; then
|
|
|
|
|
echo "User is running custom LND port: ${lndPort}" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.setport.sh ${lndPort} >> ${logFile} 2>&1
|
2019-03-17 16:11:28 +01:00
|
|
|
|
else
|
|
|
|
|
echo "User is running standard LND port: ${lndPort}" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Was not able to get LND port from config." >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-04-10 00:32:14 +02:00
|
|
|
|
# DNS Server
|
|
|
|
|
if [ ${#dnsServer} -gt 0 ]; then
|
|
|
|
|
echo "Provisioning DNS Server - Setting DNS Server" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/internet.dns.sh ${dnsServer} >> ${logFile} 2>&1
|
2019-04-10 00:32:14 +02:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning DNS Server - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-03-24 23:41:40 +01:00
|
|
|
|
# CHANTOOLS
|
|
|
|
|
if [ "${chantools}" == "on" ]; then
|
|
|
|
|
echo "Provisioning chantools - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Chantools"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bonus.chantools.sh on >> ${logFile} 2>&1
|
2021-03-24 23:41:40 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning chantools - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-04-04 00:13:42 +02:00
|
|
|
|
# SSH TUNNEL
|
|
|
|
|
if [ "${#sshtunnel}" -gt 0 ]; then
|
|
|
|
|
echo "Provisioning SSH Tunnel - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup SSH Tunnel"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/internet.sshtunnel.py restore ${sshtunnel} >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2019-04-04 00:13:42 +02:00
|
|
|
|
echo "Provisioning SSH Tunnel - not active" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-23 20:08:52 +02:00
|
|
|
|
# ZEROTIER
|
|
|
|
|
if [ "${#zerotier}" -gt 0 ] && [ "${zerotier}" != "off" ]; then
|
|
|
|
|
echo "Provisioning ZeroTier - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup ZeroTier"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bonus.zerotier.sh on ${zerotier} >> ${logFile} 2>&1
|
2020-06-23 20:08:52 +02:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning ZeroTier - not active" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-07-29 00:42:19 +02:00
|
|
|
|
# LCD ROTATE
|
2021-08-30 00:03:20 +02:00
|
|
|
|
if [ ${#lcdrotate} -eq 0 ]; then
|
2020-03-22 01:54:15 +01:00
|
|
|
|
# when upgrading from an old raspiblitz - enforce lcdrotate = 0
|
|
|
|
|
lcdrotate=0
|
2019-07-29 00:42:19 +02:00
|
|
|
|
fi
|
2021-08-30 00:03:20 +02:00
|
|
|
|
if [ "${lcdrotate}" == "0" ]; then
|
|
|
|
|
echo "Provisioning LCD rotate - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "LCD Rotate"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.display.sh rotate ${lcdrotate} >> ${logFile} 2>&1
|
2021-08-30 00:03:20 +02:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LCD rotate - not needed, keep default rotate on" >> ${logFile}
|
|
|
|
|
fi
|
2019-07-29 00:42:19 +02:00
|
|
|
|
|
2020-01-26 04:14:24 +01:00
|
|
|
|
# TOUCHSCREEN
|
2019-07-02 22:59:32 +02:00
|
|
|
|
if [ "${#touchscreen}" -gt 0 ]; then
|
|
|
|
|
echo "Provisioning Touchscreen - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Touchscreen"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.touchscreen.sh ${touchscreen} >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2019-07-02 22:59:32 +02:00
|
|
|
|
echo "Provisioning Touchscreen - not active" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-08-05 23:10:56 +02:00
|
|
|
|
# UPS
|
|
|
|
|
if [ "${#ups}" -gt 0 ]; then
|
|
|
|
|
echo "Provisioning UPS - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup UPS"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.ups.sh on ${ups} >> ${logFile} 2>&1
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2019-08-05 23:10:56 +02:00
|
|
|
|
echo "Provisioning UPS - not active" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-04-22 20:57:32 +02:00
|
|
|
|
# LNbits
|
2020-04-23 23:08:14 +02:00
|
|
|
|
if [ "${LNBits}" = "on" ]; then
|
2021-12-16 20:10:03 +01:00
|
|
|
|
if [ "${LNBitsFunding}" == "" ]; then
|
|
|
|
|
LNBitsFunding="lnd"
|
|
|
|
|
fi
|
|
|
|
|
echo "Provisioning LNbits (${LNBitsFunding}) - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup LNbits (${LNBitsFunding})"
|
2021-12-16 20:10:03 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.lnbits.sh on ${LNBitsFunding} >> ${logFile} 2>&1
|
2020-02-10 20:44:41 +01:00
|
|
|
|
else
|
2020-04-22 20:57:32 +02:00
|
|
|
|
echo "Provisioning LNbits - keep default" >> ${logFile}
|
2020-02-10 20:44:41 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2020-03-24 11:54:47 +01:00
|
|
|
|
# JoinMarket
|
|
|
|
|
if [ "${joinmarket}" = "on" ]; then
|
|
|
|
|
echo "Provisioning JoinMarket - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup JoinMarket"
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/bonus.joinmarket.sh on >> ${logFile} 2>&1
|
2020-03-24 11:54:47 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning JoinMarket - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-01 16:47:54 +01:00
|
|
|
|
# Jam
|
|
|
|
|
if [ "${jam}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Jam - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup Jam"
|
|
|
|
|
sudo /home/admin/config.scripts/bonus.jam.sh on >> ${logFile} 2>&1
|
2022-01-15 11:00:36 +01:00
|
|
|
|
else
|
2022-11-01 16:47:54 +01:00
|
|
|
|
echo "Provisioning Jam - keep default" >> ${logFile}
|
2022-01-15 11:00:36 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2020-04-26 01:45:39 +02:00
|
|
|
|
# Specter
|
2020-03-30 18:39:05 +02:00
|
|
|
|
if [ "${specter}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Specter - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Specter"
|
2021-08-23 18:23:01 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.specter.sh on >> ${logFile} 2>&1
|
2020-03-30 18:39:05 +02:00
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Specter - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-05-15 19:50:04 +02:00
|
|
|
|
# Faraday
|
|
|
|
|
if [ "${faraday}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Faraday - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Faraday"
|
2020-05-15 19:50:04 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.faraday.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Faraday - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-05-18 16:25:39 +02:00
|
|
|
|
# BOS
|
|
|
|
|
if [ "${bos}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Balance of Satoshis - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Balance of Satoshis"
|
2020-05-18 16:25:39 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.bos.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Balance of Satoshis - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2023-02-15 09:49:21 +01:00
|
|
|
|
# LNPROXY
|
|
|
|
|
if [ "${lnproxy}" = "on" ]; then
|
|
|
|
|
echo "Provisioning lnproxy - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup lnproxy"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.lnproxy.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning lnproxy - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-01 12:52:40 +02:00
|
|
|
|
# thunderhub
|
|
|
|
|
if [ "${thunderhub}" = "on" ]; then
|
|
|
|
|
echo "Provisioning ThunderHub - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup ThunderHub"
|
2020-06-01 12:52:40 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.thunderhub.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning ThunderHub - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-01-12 02:22:29 +01:00
|
|
|
|
# mempool space
|
2020-10-07 22:21:19 +02:00
|
|
|
|
if [ "${mempoolExplorer}" = "on" ]; then
|
2021-01-12 02:22:29 +01:00
|
|
|
|
echo "Provisioning MempoolSpace - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Mempool Space"
|
2020-10-07 22:21:19 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.mempool.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Mempool Explorer - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-08 22:41:17 +02:00
|
|
|
|
# letsencrypt
|
|
|
|
|
if [ "${letsencrypt}" = "on" ]; then
|
|
|
|
|
echo "Provisioning letsencrypt - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup letsencrypt"
|
2020-06-08 22:41:17 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.letsencrypt.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning letsencrypt - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-30 11:13:11 +02:00
|
|
|
|
# kindle-display
|
|
|
|
|
if [ "${kindleDisplay}" = "on" ]; then
|
|
|
|
|
echo "Provisioning kindle-display - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup kindle-display"
|
2020-06-30 11:13:11 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.kindle-display.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning kindle-display - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-10-19 01:54:28 +02:00
|
|
|
|
# pyblock
|
|
|
|
|
if [ "${pyblock}" = "on" ]; then
|
|
|
|
|
echo "Provisioning pyblock - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup pyblock"
|
2020-10-19 01:54:28 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.pyblock.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning pyblock - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-29 21:45:57 +02:00
|
|
|
|
# stacking-sats-kraken
|
|
|
|
|
if [ "${stackingSatsKraken}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Stacking Sats Kraken - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Stacking Sats Kraken"
|
2020-06-29 21:45:57 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.stacking-sats-kraken.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Stacking Sats Kraken - keep default" >> ${logFile}
|
|
|
|
|
fi
|
2020-06-08 22:41:17 +02:00
|
|
|
|
|
2021-08-29 13:29:45 +02:00
|
|
|
|
# Pool - install only if LiT won't be installed
|
|
|
|
|
if [ "${pool}" = "on" ] && [ "${lit}" != "on" ]; then
|
2021-08-17 15:59:33 +02:00
|
|
|
|
echo "Provisioning Pool - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Pool"
|
2021-08-17 15:59:33 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.pool.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Pool - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-04-18 18:04:59 +02:00
|
|
|
|
# lit (make sure to be installed after RTL)
|
|
|
|
|
if [ "${lit}" = "on" ]; then
|
|
|
|
|
echo "Provisioning LIT - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup LIT"
|
2021-04-18 18:04:59 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.lit.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LIT - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-12-09 21:49:44 +01:00
|
|
|
|
# lndg
|
|
|
|
|
if [ "${lndg}" = "on" ]; then
|
|
|
|
|
echo "Provisioning LNDg - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup LNDg"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.lndg.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LNDg - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-11-15 22:07:53 +01:00
|
|
|
|
# sphinxrelay
|
|
|
|
|
if [ "${sphinxrelay}" = "on" ]; then
|
|
|
|
|
echo "Sphinx-Relay - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Sphinx-Relay"
|
2020-11-15 22:07:53 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.sphinxrelay.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Sphinx-Relay - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-02-19 15:45:02 +01:00
|
|
|
|
# helipad
|
|
|
|
|
if [ "${helipad}" = "on" ]; then
|
|
|
|
|
echo "Helipad - run config script" >> ${logFile}
|
2022-02-19 19:49:13 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Helipad"
|
2022-02-19 18:59:48 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.helipad.sh on >> ${logFile} 2>&1
|
2022-02-19 15:45:02 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Helipad - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-01-10 21:10:55 +01:00
|
|
|
|
# circuitbreaker
|
|
|
|
|
if [ "${circuitbreaker}" = "on" ]; then
|
|
|
|
|
echo "Provisioning CircuitBreaker - run config script" >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup CircuitBreaker"
|
2021-01-10 21:10:55 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.circuitbreaker.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning CircuitBreaker - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-05-17 22:08:25 +02:00
|
|
|
|
# homer
|
|
|
|
|
if [ "${homer}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Homer - run config script" >> ${logFile}
|
|
|
|
|
sudo sed -i "s/^message=.*/message='Setup Homer'/g" ${infoFile}
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.homer.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Homer - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-12-21 15:45:01 +01:00
|
|
|
|
# tallycoin_connect
|
|
|
|
|
if [ "${tallycoinConnect}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Tallycoin Connect - run config script" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Tallycoin Connect"
|
2021-12-21 15:45:01 +01:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Tallycoin Connect - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-02-10 22:04:10 +01:00
|
|
|
|
# bitcoinminds.org
|
|
|
|
|
if [ "${bitcoinminds}" = "on" ]; then
|
|
|
|
|
echo "Provisioning bitcoinminds.org - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup Bitcoinminds.org"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.bitcoinminds.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning bitcoinminds.org - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2021-11-30 06:23:58 +01:00
|
|
|
|
# squeaknode
|
|
|
|
|
if [ "${squeaknode}" = "on" ]; then
|
|
|
|
|
echo "Provisioning Squeaknode - run config script" >> ${logFile}
|
|
|
|
|
sudo sed -i "s/^message=.*/message='Setup Squeaknode '/g" ${infoFile}
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.squeaknode.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning Squeaknode - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-05-21 12:05:00 +02:00
|
|
|
|
# itchysats
|
|
|
|
|
if [ "${itchysats}" = "on" ]; then
|
|
|
|
|
echo "Provisioning ItchySats - run config script" >> ${logFile}
|
|
|
|
|
sudo sed -i "s/^message=.*/message='Setup ItchySats'/g" ${infoFile}
|
2022-06-01 20:51:08 +02:00
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.itchysats.sh on --download >> ${logFile} 2>&1
|
2022-05-21 12:05:00 +02:00
|
|
|
|
else
|
|
|
|
|
echo "ItchySats - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2022-12-08 21:33:27 +01:00
|
|
|
|
# LightningTipBot
|
|
|
|
|
if [ "${lightningtipbot}" = "on" ]; then
|
|
|
|
|
echo "Provisioning LightningTipBot - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup LightningTipBot"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.lightningtipbot.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning LightningTipBot - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2023-04-03 12:59:45 +02:00
|
|
|
|
# FinTS
|
|
|
|
|
if [ "${fints}" = "on" ]; then
|
|
|
|
|
echo "Provisioning FinTS - run config script" >> ${logFile}
|
|
|
|
|
/home/admin/_cache.sh set message "Setup FinTS"
|
|
|
|
|
sudo -u admin /home/admin/config.scripts/bonus.fints.sh on >> ${logFile} 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "Provisioning FinTS - keep default" >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2020-07-16 15:54:42 +02:00
|
|
|
|
# custom install script from user
|
2022-01-13 19:44:13 +01:00
|
|
|
|
customInstallAvailable=$(ls /mnt/hdd/app-data/custom-installs.sh 2>/dev/null | grep -c "custom-installs.sh")
|
2020-07-16 15:54:42 +02:00
|
|
|
|
if [ ${customInstallAvailable} -gt 0 ]; then
|
2020-07-17 23:27:49 +02:00
|
|
|
|
echo "Running the custom install script .." >> ${logFile}
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Running Custom Install Script"
|
2020-07-17 11:45:55 +02:00
|
|
|
|
# copy script over to admin (in case HDD is not allowing exec)
|
2022-01-13 19:44:13 +01:00
|
|
|
|
cp -av /mnt/hdd/app-data/custom-installs.sh /home/admin/custom-installs.sh >> ${logFile}
|
2020-07-17 11:45:55 +02:00
|
|
|
|
# make sure script is executable
|
2022-01-13 19:44:13 +01:00
|
|
|
|
chmod +x /home/admin/custom-installs.sh >> ${logFile}
|
2020-07-17 23:27:49 +02:00
|
|
|
|
# run it & delete it again
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/custom-installs.sh >> ${logFile}
|
|
|
|
|
rm /home/admin/custom-installs.sh >> ${logFile}
|
2020-07-17 23:27:49 +02:00
|
|
|
|
echo "Done" >> ${logFile}
|
2020-07-16 15:54:42 +02:00
|
|
|
|
else
|
|
|
|
|
echo "No custom install script ... adding the placeholder." >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
cp /home/admin/assets/custom-installs.sh /mnt/hdd/app-data/custom-installs.sh
|
2020-07-16 15:54:42 +02:00
|
|
|
|
fi
|
2020-06-08 22:41:17 +02:00
|
|
|
|
|
2019-04-27 16:14:26 +02:00
|
|
|
|
# replay backup LND conf & tlscerts
|
2019-04-02 22:00:39 +02:00
|
|
|
|
# https://github.com/rootzoll/raspiblitz/issues/324
|
|
|
|
|
echo "" >> ${logFile}
|
2019-04-27 16:14:26 +02:00
|
|
|
|
echo "*** Replay backup of LND conf/tls" >> ${logFile}
|
2021-12-09 19:00:57 +01:00
|
|
|
|
if [ -d "/var/cache/raspiblitz/tls_backup" ]; then
|
2019-04-27 16:14:26 +02:00
|
|
|
|
|
|
|
|
|
echo "Copying TLS ..." >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
cp /var/cache/raspiblitz/tls_backup/tls.cert /mnt/hdd/lnd/tls.cert >> ${logFile} 2>&1
|
|
|
|
|
cp /var/cache/raspiblitz/tls_backup/tls.key /mnt/hdd/lnd/tls.key >> ${logFile} 2>&1
|
|
|
|
|
chown -R bitcoin:bitcoin /mnt/hdd/lnd >> ${logFile} 2>&1
|
2019-04-27 16:14:26 +02:00
|
|
|
|
echo "On next final restart admin creds will be updated by _boostrap.sh" >> ${logFile}
|
|
|
|
|
|
2019-04-02 22:00:39 +02:00
|
|
|
|
echo "DONE" >> ${logFile}
|
|
|
|
|
else
|
|
|
|
|
echo "No BackupDir so skipping that step." >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
echo "" >> ${logFile}
|
|
|
|
|
|
2019-12-15 15:29:45 +01:00
|
|
|
|
# repair Bitcoin conf if needed
|
2021-05-18 21:50:10 +02:00
|
|
|
|
echo "*** Repair Bitcoin Conf (if needed)" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
confExists="$(ls /mnt/hdd/${network} | grep -c "${network}.conf")"
|
2019-12-15 15:29:45 +01:00
|
|
|
|
if [ ${confExists} -eq 0 ]; then
|
|
|
|
|
echo "Doing init of ${network}.conf" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
cp /home/admin/assets/bitcoin.conf /mnt/hdd/bitcoin/bitcoin.conf
|
|
|
|
|
chown bitcoin:bitcoin /mnt/hdd/bitcoin/bitcoin.conf
|
2019-12-15 15:29:45 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2021-08-27 09:59:21 +02:00
|
|
|
|
# signal setup done
|
2021-12-14 23:34:35 +01:00
|
|
|
|
/home/admin/_cache.sh set message "Setup Done"
|
2019-02-18 18:41:12 +01:00
|
|
|
|
|
2019-12-10 14:47:23 +01:00
|
|
|
|
# set the local network hostname (just if set in config - will not be set anymore by default in newer version)
|
2019-04-03 01:44:55 +02:00
|
|
|
|
# have at the end - see https://github.com/rootzoll/raspiblitz/issues/462
|
2019-12-10 14:47:23 +01:00
|
|
|
|
# see also https://github.com/rootzoll/raspiblitz/issues/819
|
2019-04-03 01:44:55 +02:00
|
|
|
|
if [ ${#hostname} -gt 0 ]; then
|
|
|
|
|
hostnameSanatized=$(echo "${hostname}"| tr -dc '[:alnum:]\n\r')
|
|
|
|
|
if [ ${#hostnameSanatized} -gt 0 ]; then
|
2021-12-23 14:48:42 +01:00
|
|
|
|
if [ "${setnetworkname}" == "1" ]; then
|
2019-12-10 14:47:23 +01:00
|
|
|
|
echo "Setting new network hostname '$hostnameSanatized'" >> ${logFile}
|
2021-12-23 14:48:42 +01:00
|
|
|
|
if [ "${baseimage}" == "raspios_arm64" ]; then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
raspi-config nonint do_hostname ${hostnameSanatized} >> ${logFile} 2>&1
|
2021-12-23 14:48:42 +01:00
|
|
|
|
else
|
|
|
|
|
hostnameCurrent=$(hostname)
|
2022-01-13 19:44:13 +01:00
|
|
|
|
sed -i "s/${hostnameCurrent}/${hostnameSanatized}/g" /etc/hostname 2>&1
|
|
|
|
|
sed -i "s/${hostnameCurrent}/${hostnameSanatized}/g" /etc/hosts 2>&1
|
2021-12-23 14:48:42 +01:00
|
|
|
|
fi
|
2019-12-10 14:47:23 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Not setting local network hostname" >> ${logFile}
|
|
|
|
|
fi
|
2019-04-03 01:44:55 +02:00
|
|
|
|
else
|
|
|
|
|
echo "WARNING: hostname in raspiblitz.conf contains just special chars" >> ${logFile}
|
|
|
|
|
fi
|
2019-09-22 15:34:03 +02:00
|
|
|
|
else
|
2019-04-03 01:44:55 +02:00
|
|
|
|
echo "No hostname set." >> ${logFile}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-12-12 14:51:21 +01:00
|
|
|
|
# PERMANENT MOUNT OF HDD/SSD
|
|
|
|
|
# always at the end, because data drives will be just available again after a reboot
|
|
|
|
|
echo "Prepare fstab for permanent data drive mounting .." >> ${logFile}
|
|
|
|
|
# get info on data drive
|
2022-01-13 19:44:13 +01:00
|
|
|
|
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
2019-12-12 14:51:21 +01:00
|
|
|
|
# update /etc/fstab
|
|
|
|
|
echo "datadisk --> ${datadisk}" >> ${logFile}
|
2020-09-21 21:59:37 +02:00
|
|
|
|
echo "datapartition --> ${datapartition}" >> ${logFile}
|
2020-11-01 11:24:12 +01:00
|
|
|
|
if [ ${isBTRFS} -eq 0 ]; then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.datadrive.sh fstab ${datapartition} >> ${logFile}
|
2020-11-01 11:24:12 +01:00
|
|
|
|
else
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/blitz.datadrive.sh fstab ${datadisk} >> ${logFile}
|
2020-11-01 11:24:12 +01:00
|
|
|
|
fi
|
2019-12-12 14:51:21 +01:00
|
|
|
|
|
2021-08-04 00:18:30 +02:00
|
|
|
|
# MAKE SURE SERVICES ARE RUNNING
|
|
|
|
|
echo "Make sure main services are running .." >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
systemctl start ${network}d
|
2021-08-04 00:18:30 +02:00
|
|
|
|
if [ "${lightning}" == "lnd" ];then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
systemctl start lnd
|
2021-09-08 23:52:31 +02:00
|
|
|
|
# set password c if given in flag from migration prep
|
2022-01-13 19:44:13 +01:00
|
|
|
|
passwordFlagExists=$(ls /mnt/hdd/passwordc.flag | grep -c "passwordc.flag")
|
2021-09-08 23:52:31 +02:00
|
|
|
|
if [ "${passwordFlagExists}" == "1" ]; then
|
|
|
|
|
echo "Found /mnt/hdd/passwordc.flag .. changing password" >> ${logFile}
|
2022-01-13 19:44:13 +01:00
|
|
|
|
oldPasswordC=$(cat /mnt/hdd/passwordc.flag)
|
2021-11-30 12:58:06 +01:00
|
|
|
|
if ! pip list | grep grpc; then sudo -H python3 -m pip install grpcio==1.38.1; fi
|
2022-01-13 19:44:13 +01:00
|
|
|
|
/home/admin/config.scripts/lnd.initwallet.py change-password mainnet "${oldPasswordC}" "${passwordC}" >> ${logFile}
|
|
|
|
|
shred -u /mnt/hdd/passwordc.flag
|
2021-09-08 23:52:31 +02:00
|
|
|
|
else
|
|
|
|
|
echo "No /mnt/hdd/passwordc.flag" >> ${logFile}
|
|
|
|
|
fi
|
2021-09-26 11:30:09 +02:00
|
|
|
|
elif [ "${lightning}" == "cl" ];then
|
2022-01-13 19:44:13 +01:00
|
|
|
|
systemctl start lightningd
|
2021-08-04 00:18:30 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2019-11-26 22:02:53 +01:00
|
|
|
|
echo "DONE - Give raspi some cool off time after hard building .... 5 secs sleep" >> ${logFile}
|
|
|
|
|
sleep 5
|
2019-02-18 18:41:12 +01:00
|
|
|
|
|
2019-09-22 15:34:03 +02:00
|
|
|
|
echo "END Provisioning" >> ${logFile}
|
2021-09-29 14:11:50 +02:00
|
|
|
|
exit 0
|