raspiblitz/home.admin/00settingsMenuBasics.sh

529 lines
16 KiB
Bash
Raw Normal View History

2020-06-17 23:40:24 +02:00
#!/bin/bash
# get raspiblitz config
echo "get raspiblitz config"
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
echo "services default values"
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
2020-06-17 23:40:24 +02:00
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
if [ ${#autoNatDiscovery} -eq 0 ]; then autoNatDiscovery="off"; fi
if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi
if [ ${#touchscreen} -eq 0 ]; then touchscreen=0; fi
if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
2020-06-23 18:53:28 +02:00
if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi
if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
if [ ${#clnEncryptedHSM} -eq 0 ]; then clnEncryptedHSM="off"; fi
if [ ${#clnAutoUnlock} -eq 0 ]; then clnAutoUnlock="off"; fi
2020-06-17 23:40:24 +02:00
2021-08-30 20:19:57 +02:00
echo "# map LND to on/off"
lndNode="off"
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
lndNode="on"
fi
echo "# map CLN to on/off"
clnNode="off"
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
clnNode="on"
fi
echo "map nextcloudbackup to on/off"
NextcloudBackup="off"
if [ $nextcloudBackupServer ] && [ $nextcloudBackupUser ] && [ $nextcloudBackupPassword ]; then NextcloudBackup="on"; fi
2021-08-30 20:19:57 +02:00
echo "# map localbackup to on/off"
LocalBackup="off"
if [ ${#localBackupDeviceUUID} -gt 0 ] && [ "${localBackupDeviceUUID}" != "off" ]; then LocalBackup="on"; fi
2021-08-30 20:19:57 +02:00
echo "# map zerotier to on/off"
2020-06-23 22:14:22 +02:00
zerotierSwitch="off"
2020-06-23 22:15:55 +02:00
if [ "${zerotier}" != "off" ]; then zerotierSwitch="on"; fi
2020-06-23 22:14:22 +02:00
2021-08-30 20:19:57 +02:00
echo "# map parallel testnets to on/off"
parallelTestnets="off"
if [ "${testnet}" == "on" ] || [ "${signet}" == "on" ]; then
2021-08-30 20:19:57 +02:00
parallelTestnets="on"
fi
2020-06-17 23:40:24 +02:00
2021-08-30 20:19:57 +02:00
echo "# map domain to on/off"
2020-06-17 23:40:24 +02:00
domainValue="off"
dynDomainMenu='DynamicDNS'
if [ ${#dynDomain} -gt 0 ]; then
domainValue="on"
dynDomainMenu="${dynDomain}"
fi
2021-08-30 20:19:57 +02:00
echo "# map lcdrotate to on/off"
2020-06-17 23:40:24 +02:00
lcdrotateMenu='off'
if [ ${lcdrotate} -gt 0 ]; then
lcdrotateMenu='on'
fi
2021-08-30 20:19:57 +02:00
echo "# map touchscreen to on/off"
2020-06-17 23:40:24 +02:00
touchscreenMenu='off'
if [ ${touchscreen} -gt 0 ]; then
touchscreenMenu='on'
fi
2021-08-30 20:19:57 +02:00
echo "# map autopilot to on/off"
lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep -c 'autopilot.active=1')
2020-06-17 23:40:24 +02:00
if [ ${lndAutoPilotOn} -eq 1 ]; then
autoPilot="on"
2020-06-17 23:40:24 +02:00
else
autoPilot="off"
2020-06-17 23:40:24 +02:00
fi
2021-08-30 20:19:57 +02:00
echo "# map keysend to on/off"
2020-06-17 23:40:24 +02:00
keysend="on"
source <(sudo /home/admin/config.scripts/lnd.keysend.sh status)
if [ ${keysendOn} -eq 0 ]; then
keysend="off"
fi
echo "# map clboss to on/off"
clbossMenu='off'
if [ "${clboss}" == "on" ]; then
clbossMenu='on'
fi
echo "# map clnEncryptedHSM to on/off"
clnEncryptedHSMMenu='off'
if [ "${clnEncryptedHSM}" == "on" ]; then
clnEncryptedHSMMenu='on'
fi
echo "# map clnAutoUnlock to on/off"
clnAutoUnlockMenu='off'
if [ "${clnAutoUnlock}" == "on" ]; then
clnAutoUnlockMenu='on'
fi
2020-06-17 23:40:24 +02:00
# show select dialog
echo "run dialog ..."
# BASIC MENU INFO
2020-06-17 23:40:24 +02:00
OPTIONS=()
2021-08-30 20:19:57 +02:00
# LCD options (only when running with LCD screen)
if [ "${displayClass}" == "lcd" ]; then
OPTIONS+=(s 'Touchscreen' ${touchscreenMenu})
OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
fi
2021-08-30 20:19:57 +02:00
# Important basic options
OPTIONS+=(t 'Run behind Tor' ${runBehindTor})
2020-06-23 22:14:22 +02:00
OPTIONS+=(z 'ZeroTier' ${zerotierSwitch})
2020-06-17 23:40:24 +02:00
2021-08-30 20:19:57 +02:00
if [ ${#runBehindTor} -eq 0 ] || [ "${runBehindTor}" = "off" ]; then
OPTIONS+=(y ${dynDomainMenu} ${domainValue})
OPTIONS+=(b 'BTC UPnP (AutoNAT)' ${networkUPnP})
fi
OPTIONS+=(p 'Parallel Testnet/Signet' ${parallelTestnets})
# LND & options (only when running LND)
OPTIONS+=(m 'LND LIGHTNING LABS NODE' ${lndNode})
if [ "${lndNode}" == "on" ]; then
OPTIONS+=(a '-LND Channel Autopilot' ${autoPilot})
OPTIONS+=(k '-LND Accept Keysend' ${keysend})
OPTIONS+=(c '-LND Circuitbreaker (firewall)' ${circuitbreaker})
OPTIONS+=(u '-LND Auto-Unlock' ${autoUnlock})
OPTIONS+=(x '-LND StaticChannelBackup on Nextcloud' ${NextcloudBackup})
2021-08-30 20:19:57 +02:00
OPTIONS+=(e '-LND StaticChannelBackup USB Drive' ${LocalBackup})
OPTIONS+=(l '-LND UPnP (AutoNAT)' ${autoNatDiscovery})
fi
2020-06-17 23:40:24 +02:00
2021-08-30 20:19:57 +02:00
# C-Lightning & options/PlugIns
OPTIONS+=(n 'CLN C-LIGHTNING NODE' ${clnNode})
if [ "${clnNode}" == "on" ]; then
OPTIONS+=(o '-CLN CLBOSS Automatic Node Manager' ${clbossMenu})
OPTIONS+=(h '-CLN Wallet Encryption' ${clnEncryptedHSMMenu})
if [ "${clnEncryptedHSM}" == "on" ]; then
OPTIONS+=(q '-CLN Auto-Unlock' ${clnAutoUnlockMenu})
fi
fi
2021-08-30 20:19:57 +02:00
2021-08-16 16:41:23 +02:00
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
HEIGHT=$((CHOICE_HEIGHT+6))
2021-09-14 17:53:15 +02:00
CHOICES=$(dialog --title ' Node Settings & Options ' --checklist ' use spacebar to activate/de-activate ' $HEIGHT 55 $CHOICE_HEIGHT "${OPTIONS[@]}" 2>&1 >/dev/tty)
2020-06-17 23:40:24 +02:00
dialogcancel=$?
clear
# check if user canceled dialog
2021-08-03 21:03:10 +02:00
echo "dialogcancel(${dialogcancel}) (${CHOICE_HEIGHT})"
2020-06-17 23:40:24 +02:00
if [ ${dialogcancel} -eq 1 ]; then
echo "user canceled"
2021-08-03 16:15:32 +02:00
exit 0
2020-06-17 23:40:24 +02:00
elif [ ${dialogcancel} -eq 255 ]; then
echo "ESC pressed"
2021-08-03 16:15:32 +02:00
exit 0
2020-06-17 23:40:24 +02:00
fi
needsReboot=0
anychange=0
2021-08-30 20:49:48 +02:00
# LND AUTOPILOT process choice
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${autoPilot}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
2020-06-17 23:40:24 +02:00
echo "Autopilot Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice}
needsReboot=1
else
echo "Autopilot Setting unchanged."
fi
# Dynamic Domain
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "y")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${domainValue}" != "${choice}" ]; then
echo "Dynamic Domain changed .."
anychange=1
sudo /home/admin/config.scripts/internet.dyndomain.sh ${choice}
needsReboot=1
else
echo "Dynamic Domain unchanged."
fi
# UPnP
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "b")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${networkUPnP}" != "${choice}" ]; then
echo "BTC UPnP Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh on
networkUPnP="on"
needsReboot=1
else
echo "Stopping BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh off
networkUPnP="off"
needsReboot=1
fi
else
echo "BTC UPnP Setting unchanged."
fi
2021-08-30 20:49:48 +02:00
# LND AutoNAT
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${autoNatDiscovery}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
2020-06-17 23:40:24 +02:00
echo "AUTO NAT Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh on
autoNatDiscovery="on"
needsReboot=1
else
echo "Stopping autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh off
autoNatDiscovery="off"
needsReboot=1
fi
else
echo "LND AUTONAT Setting unchanged."
fi
2021-08-25 12:11:25 +02:00
# Tor process choice
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${runBehindTor}" != "${choice}" ]; then
2021-08-25 12:11:25 +02:00
echo "Tor Setting changed .."
2020-06-17 23:40:24 +02:00
2021-08-25 12:11:25 +02:00
# special actions if Tor is turned on
2020-06-17 23:40:24 +02:00
if [ "${choice}" = "on" ]; then
# inform user about privacy risk
whiptail --title " PRIVACY NOTICE " --msgbox "
2021-08-25 12:11:25 +02:00
RaspiBlitz will now install/activate Tor & after reboot run behind it.
2020-06-17 23:40:24 +02:00
2021-08-25 12:11:25 +02:00
Please keep in mind that thru your LND node id & your previous IP history with your internet provider your lightning node could still be linked to your personal id even when running behind Tor. To unlink you from that IP history its recommended that after the switch/reboot to Tor you also use the REPAIR > RESET-LND option to create a fresh LND wallet. That might involve closing all channels & move your funds out of RaspiBlitz before that RESET-LND.
2020-06-17 23:40:24 +02:00
" 16 76
# make sure AutoNAT & UPnP is off
/home/admin/config.scripts/lnd.autonat.sh off
/home/admin/config.scripts/network.upnp.sh off
fi
2021-08-25 12:11:25 +02:00
# change Tor
2020-06-17 23:40:24 +02:00
anychange=1
sudo /home/admin/config.scripts/internet.tor.sh ${choice}
needsReboot=1
else
2021-08-25 12:11:25 +02:00
echo "Tor Setting unchanged."
2020-06-17 23:40:24 +02:00
fi
# LND Auto-Unlock
2020-06-18 00:43:39 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "u")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${autoUnlock}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
2020-06-17 23:40:24 +02:00
echo "LND Autounlock Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autounlock.sh ${choice}
if [ $? -eq 0 ]; then
l1="AUTO-UNLOCK IS NOW OFF"
if [ "${choice}" = "on" ]; then
l1="AUTO-UNLOCK IS NOW ACTIVE"
fi
dialog --title 'OK' --msgbox "\n${l1}\n" 9 50
needsReboot=1
fi
2020-06-17 23:40:24 +02:00
else
echo "LND Autounlock Setting unchanged."
fi
# lcd rotate
choice="0"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
anychange=1
2021-04-08 00:02:57 +02:00
sudo /home/admin/config.scripts/blitz.display.sh rotate ${choice}
needsReboot=1
else
echo "LCD Rotate Setting unchanged."
fi
2020-06-17 23:40:24 +02:00
# touchscreen
2020-06-18 00:43:39 +02:00
choice="0"; check=$(echo "${CHOICES}" | grep -c "s")
2020-06-17 23:40:24 +02:00
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${touchscreen}" != "${choice}" ]; then
echo "Touchscreen Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.touchscreen.sh ${choice}
if [ "${choice}" == "1" ]; then
dialog --title 'Touchscreen Activated' --msgbox 'Touchscreen was activated - will reboot.\n\nAfter reboot use the SCREEN option in main menu to calibrate the touchscreen.' 9 48
fi
needsReboot=1
else
echo "Touchscreen Setting unchanged."
fi
2021-08-30 20:49:48 +02:00
# LND circuitbreaker
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${circuitbreaker}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
echo "Circuitbreaker Setting changed .."
2020-06-17 23:40:24 +02:00
anychange=1
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh ${choice}
2020-06-17 23:40:24 +02:00
else
echo "Circuitbreaker Setting unchanged."
2020-06-17 23:40:24 +02:00
fi
# Nextcloud process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "x")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${NextcloudBackup}" != "${choice}" ]; then
echo "Nextcloud Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/nextcloud.upload.sh ${choice}
if [ "${choice}" = "on" ]; then
# doing initial upload so that user can see result
source /mnt/hdd/raspiblitz.conf
sudo /home/admin/config.scripts/nextcloud.upload.sh upload /mnt/hdd/lnd/data/chain/${network}/${chain}net/channel.backup
fi
else
echo "Nextcloud backup setting unchanged."
fi
# LocalBackup process choice
2020-07-04 16:01:25 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "e")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${LocalBackup}" != "${choice}" ]; then
echo "BackupdDevice Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.backupdevice.sh ${choice}
else
echo "BackupdDevice setting unchanged."
fi
2021-08-30 20:49:48 +02:00
# LND Keysend process choice
2020-06-17 23:40:24 +02:00
choice="off"; check=$(echo "${CHOICES}" | grep -c "k")
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${keysend}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
2020-06-17 23:40:24 +02:00
echo "keysend setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice}
2021-09-09 21:19:28 +02:00
sudo systemctl restart lnd
dialog --msgbox "Accept Keysend on LND mainnet is now ${choice}.\n\nLND restarted - you might need to unlock wallet." 7 52
sudo -u admin /home/admin/config.scripts/lnd.unlock.sh
2020-06-17 23:40:24 +02:00
else
echo "keysend setting unchanged."
fi
2020-06-23 18:53:28 +02:00
# ZeroTier process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "z")
if [ ${check} -eq 1 ]; then choice="on"; fi
2020-07-04 15:58:14 +02:00
if [ "${zerotierSwitch}" != "${choice}" ]; then
2020-06-23 18:53:28 +02:00
echo "zerotier setting changed .."
anychange=1
2020-06-23 20:56:32 +02:00
error=""
source <(sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice})
2020-06-23 21:59:30 +02:00
if [ "${choice}" == "on" ]; then
2020-06-23 21:57:40 +02:00
if [ ${#error} -eq 0 ]; then
dialog --msgbox "Your RaspiBlitz joined the ZeroTier network." 6 46
else
if [ "${error}" != "cancel" ]; then
dialog --msgbox "ZeroTier Error:\n${error}" 8 46
fi
2020-06-23 20:56:32 +02:00
fi
2020-06-23 21:57:40 +02:00
else
dialog --msgbox "ZeroTier is now OFF." 5 46
2020-06-23 20:56:32 +02:00
fi
2020-06-23 18:53:28 +02:00
else
echo "ZeroTier setting unchanged."
fi
2021-08-30 20:19:57 +02:00
# LND choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "m")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${lndNode}" != "${choice}" ]; then
2021-08-30 20:39:13 +02:00
anychange=1
2021-08-30 20:19:57 +02:00
echo "# LND NODE Setting changed .."
if [ "${choice}" = "on" ]; then
echo "# turning ON"
/home/admin/config.scripts/lnd.install.sh on mainnet initwallet
sudo /home/admin/config.scripts/lnd.install.sh display-seed mainnet delete
2021-08-30 20:19:57 +02:00
if [ "${testnet}" == "on" ]; then
/home/admin/config.scripts/lnd.install.sh on testnet initwallet
2021-08-30 20:19:57 +02:00
fi
2021-09-01 18:49:53 +02:00
if [ "${signet}" == "on" ]; then
/home/admin/config.scripts/lnd.install.sh on signet initwallet
2021-08-30 20:19:57 +02:00
fi
else
echo "# turning OFF"
2021-09-01 18:47:28 +02:00
/home/admin/config.scripts/lnd.install.sh off mainnet
/home/admin/config.scripts/lnd.install.sh off testnet
/home/admin/config.scripts/lnd.install.sh off signet
2021-08-30 20:19:57 +02:00
fi
else
echo "LND NODE setting unchanged."
fi
# CLN choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "n")
if [ ${check} -eq 1 ]; then choice="on"; fi
2021-08-30 20:49:48 +02:00
if [ "${clnNode}" != "${choice}" ]; then
2021-08-30 20:39:13 +02:00
anychange=1
2021-08-30 20:19:57 +02:00
echo "# C-Lightning NODE Setting changed .."
if [ "${choice}" = "on" ]; then
echo "# turning ON"
/home/admin/config.scripts/cln.install.sh on mainnet
2021-09-09 15:13:44 +02:00
sudo /home/admin/config.scripts/cln.install.sh display-seed mainnet
2021-08-30 20:19:57 +02:00
if [ "${testnet}" == "on" ]; then
/home/admin/config.scripts/cln.install.sh on testnet
fi
2021-09-01 18:49:53 +02:00
if [ "${signet}" == "on" ]; then
2021-08-30 20:19:57 +02:00
/home/admin/config.scripts/cln.install.sh on signet
fi
else
echo "# turning OFF"
/home/admin/config.scripts/cln.install.sh off mainnet
/home/admin/config.scripts/cln.install.sh off testnet
/home/admin/config.scripts/cln.install.sh off signet
fi
else
echo "C-Lightning NODE setting unchanged."
fi
# CLBOSS process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "o")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clboss}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "CLBOSS Setting changed .."
anychange=1
sudo /home/admin/config.scripts/cln-plugin.clboss.sh ${choice}
needsReboot=0
else
echo "CLBOSS Setting unchanged."
fi
# clnEncryptedHSM process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "h")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnEncryptedHSM}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "clnEncryptedHSM Setting changed .."
anychange=1
if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh encrypt mainnet
else
/home/admin/config.scripts/cln.hsmtool.sh decrypt mainnet
fi
needsReboot=0
else
echo "clnEncryptedHSM Setting unchanged."
fi
# clnAutoUnlock process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "q")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnAutoUnlock}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "clnAutoUnlock Setting changed .."
anychange=1
if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on mainnet
else
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off mainnet
fi
needsReboot=0
else
echo "clnAutoUnlock Setting unchanged."
fi
2021-08-30 20:19:57 +02:00
# parallel testnet process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "p")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${testnet}" != "${choice}" ]; then
2021-08-30 20:19:57 +02:00
echo "# Parallel Testnets Setting changed .."
anychange=1
2021-08-30 20:19:57 +02:00
if [ "${choice}" = "on" ]; then
/home/admin/config.scripts/bitcoin.install.sh on testnet
/home/admin/config.scripts/bitcoin.install.sh on signet
2021-08-30 20:19:57 +02:00
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
/home/admin/config.scripts/lnd.install.sh on testnet initwallet
/home/admin/config.scripts/lnd.install.sh on signet initwallet
fi
2021-08-30 20:19:57 +02:00
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
/home/admin/config.scripts/cln.install.sh on testnet
/home/admin/config.scripts/cln.install.sh on signet
fi
else
# just turn al lightning testnets off (even if not on before)
2021-09-01 18:47:28 +02:00
/home/admin/config.scripts/lnd.install.sh off testnet
/home/admin/config.scripts/lnd.install.sh off signet
2021-08-30 20:19:57 +02:00
/home/admin/config.scripts/cln.install.sh off testnet
/home/admin/config.scripts/cln.install.sh off signet
/home/admin/config.scripts/bitcoin.install.sh off testnet
/home/admin/config.scripts/bitcoin.install.sh off signet
fi
2021-08-30 20:19:57 +02:00
# make sure to reboot - nodes that people activate testnets can take a reboot
needsReboot=1
else
echo "# Testnet Setting unchanged."
fi
2020-06-17 23:40:24 +02:00
if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0
fi
if [ ${needsReboot} -eq 1 ]; then
sleep 2
dialog --pause "OK. System will reboot to activate changes." 8 58 8
clear
echo "rebooting .. (please wait)"
# stop bitcoind
sudo -u bitcoin ${network}-cli stop
sleep 4
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
2020-06-17 23:40:24 +02:00
fi