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"
2021-06-29 18:48:58 +01:00
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 [ ${# 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
2021-03-24 23:41:40 +01:00
if [ ${# circuitbreaker } -eq 0 ] ; then circuitbreaker = "off" ; fi
2021-09-20 12:06:57 +01:00
if [ ${# clboss } -eq 0 ] ; then clboss = "off" ; fi
2021-09-26 10:30:09 +01:00
if [ ${# clEncryptedHSM } -eq 0 ] ; then clEncryptedHSM = "off" ; fi
if [ ${# clAutoUnlock } -eq 0 ] ; then clAutoUnlock = "off" ; fi
2022-12-08 12:56:30 +01:00
if [ ${# clWatchtowerClient } -eq 0 ] ; then clWatchtowerClient = "off" ; fi
2022-06-29 21:34:57 +02:00
if [ ${# blitzapi } -eq 0 ] ; then blitzapi = "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
2021-09-26 10:30:09 +01:00
echo "# map CL to on/off"
clNode = "off"
if [ " ${ lightning } " = = "cl" ] || [ " ${ cl } " = = "on" ] ; then
clNode = "on"
2021-08-30 20:19:57 +02:00
fi
2022-01-08 22:50:51 +01:00
echo "# map nextcloudbackup to on/off"
2021-09-14 22:36:54 +07:00
NextcloudBackup = "off"
if [ $nextcloudBackupServer ] && [ $nextcloudBackupUser ] && [ $nextcloudBackupPassword ] ; then NextcloudBackup = "on" ; fi
2021-08-30 20:19:57 +02:00
echo "# map localbackup to on/off"
2020-07-04 15:45:41 +02:00
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"
2021-09-20 14:45:59 +01:00
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
2021-06-29 18:48:58 +01:00
autoPilot = "on"
2020-06-17 23:40:24 +02:00
else
2021-06-29 18:48:58 +01:00
autoPilot = "off"
2020-06-17 23:40:24 +02:00
fi
2021-09-20 12:06:57 +01:00
echo "# map clboss to on/off"
clbossMenu = 'off'
2021-09-20 14:45:59 +01:00
if [ " ${ clboss } " = = "on" ] ; then
2021-09-20 12:06:57 +01:00
clbossMenu = 'on'
fi
2021-09-26 10:30:09 +01:00
echo "# map clEncryptedHSM to on/off"
clEncryptedHSMMenu = 'off'
if [ " ${ clEncryptedHSM } " = = "on" ] ; then
clEncryptedHSMMenu = 'on'
2021-09-20 14:45:59 +01:00
fi
2021-09-26 10:30:09 +01:00
echo "# map clAutoUnlock to on/off"
clAutoUnlockMenu = 'off'
if [ " ${ clAutoUnlock } " = = "on" ] ; then
clAutoUnlockMenu = 'on'
2021-09-20 14:45:59 +01:00
fi
2022-12-08 12:56:30 +01:00
echo "# map clWatchtowerClient to on/off"
clWatchtowerClientMenu = 'off'
if [ " ${ clWatchtowerClient } " = = "on" ] ; then
clWatchtowerClientMenu = 'on'
fi
2022-01-08 22:50:51 +01:00
echo "# map keysend to on/off (may take time)"
keysend = "on"
source <( sudo /home/admin/config.scripts/lnd.keysend.sh status)
if [ ${ keysendOn } -eq 0 ] ; then
keysend = "off"
fi
2020-06-17 23:40:24 +02:00
# show select dialog
echo "run dialog ..."
2021-04-07 23:24:55 +01:00
# BASIC MENU INFO
2020-06-17 23:40:24 +02:00
OPTIONS = ( )
2021-04-07 23:24:55 +01:00
2022-06-29 21:34:57 +02:00
OPTIONS += ( A 'Blitz API + WebUI' ${ blitzapi } )
2021-08-30 20:19:57 +02:00
# LCD options (only when running with LCD screen)
2021-04-16 02:12:22 +02:00
if [ " ${ displayClass } " = = "lcd" ] ; then
2022-02-17 20:19:48 +01:00
OPTIONS += ( s 'Touchscreen (experimental)' ${ touchscreenMenu } )
2021-12-14 23:34:35 +01:00
OPTIONS += ( r 'LCD Rotate' ${ lcdrotateMenu } )
2021-04-16 02:12:22 +02:00
fi
2021-08-03 17:17:07 +02:00
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 } )
2021-12-14 23:34:35 +01:00
OPTIONS += ( b 'BTC UPnP (AutoNAT)' ${ networkUPnP } )
2021-08-30 20:19:57 +02:00
fi
OPTIONS += ( p 'Parallel Testnet/Signet' ${ parallelTestnets } )
2022-11-17 11:11:56 -06:00
# Lightning options (only LND and/or CLN)
if [ " ${ lndNode } " = = "on" ] || [ " ${ clNode } " = = "on" ] ; then
OPTIONS += ( x 'SCB/Emergency-Backup on Nextcloud' ${ NextcloudBackup } )
OPTIONS += ( e 'SCB/Emergency-Backup USB Drive' ${ LocalBackup } )
fi
2021-08-30 20:19:57 +02:00
# LND & options (only when running LND)
2021-12-14 23:34:35 +01:00
OPTIONS += ( m 'LND LIGHTNING LABS NODE' ${ lndNode } )
2021-08-30 20:19:57 +02:00
if [ " ${ lndNode } " = = "on" ] ; then
2021-12-14 23:34:35 +01:00
OPTIONS += ( a '-LND Channel Autopilot' ${ autoPilot } )
OPTIONS += ( k '-LND Accept Keysend' ${ keysend } )
OPTIONS += ( c '-LND Circuitbreaker (firewall)' ${ circuitbreaker } )
OPTIONS += ( u '-LND Auto-Unlock' ${ autoUnlock } )
2021-06-29 18:48:58 +01:00
fi
2020-06-17 23:40:24 +02:00
2022-07-27 08:29:16 +02:00
# Core Lightning & options/PlugIns
OPTIONS += ( n 'CL CORE LIGHTNING NODE' ${ clNode } )
2021-09-26 10:30:09 +01:00
if [ " ${ clNode } " = = "on" ] ; then
OPTIONS += ( o '-CL CLBOSS Automatic Node Manager' ${ clbossMenu } )
OPTIONS += ( h '-CL Wallet Encryption' ${ clEncryptedHSMMenu } )
2022-12-08 12:56:30 +01:00
OPTIONS += ( w '-CL Watchtower Client' ${ clWatchtowerClientMenu } )
2021-09-26 10:30:09 +01:00
if [ " ${ clEncryptedHSM } " = = "on" ] ; then
OPTIONS += ( q '-CL Auto-Unlock' ${ clAutoUnlockMenu } )
2021-09-20 14:45:59 +01:00
fi
2021-09-20 12:06:57 +01:00
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
2022-06-29 21:34:57 +02:00
# Blitz API + webUI process choice
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "A" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
if [ " ${ blitzapi } " != " ${ choice } " ] ; then
echo "Blitz API + webUI settings changed .."
anychange = 1
2023-02-07 21:08:26 +01:00
sudo /home/admin/config.scripts/blitz.web.api.sh ${ choice } DEFAULT
sudo /home/admin/config.scripts/blitz.web.ui.sh ${ choice } DEFAULT
2022-06-29 21:34:57 +02:00
errorOnInstall = $?
if [ " ${ choice } " = "on" ] ; then
whiptail --title " Installed Blitz API + webUI" --msgbox " \
The Blitz API + webUI was installed.\n
See the status screen for more info.\n
" 10 35
fi
else
echo "Blitz API + webUI Setting unchanged."
fi
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-25 11:11:25 +01: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 11:11:25 +01:00
echo "Tor Setting changed .."
2020-06-17 23:40:24 +02:00
2021-08-25 11:11:25 +01: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 11:11:25 +01:00
RaspiBlitz will now install/activate Tor & after reboot run behind it.
2020-06-17 23:40:24 +02:00
2021-08-25 11:11:25 +01: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
/home/admin/config.scripts/network.upnp.sh off
fi
2021-08-25 11:11:25 +01:00
# change Tor
2020-06-17 23:40:24 +02:00
anychange = 1
2021-12-14 23:34:35 +01:00
sudo /home/admin/config.scripts/tor.network.sh ${ choice }
2020-06-17 23:40:24 +02:00
needsReboot = 1
else
2021-08-25 11:11:25 +01: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 }
2020-09-15 18:43:08 +02:00
if [ $? -eq 0 ] ; then
l1 = "AUTO-UNLOCK IS NOW OFF"
if [ " ${ choice } " = "on" ] ; then
l1 = "AUTO-UNLOCK IS NOW ACTIVE"
2021-12-14 23:34:35 +01:00
fi
2020-09-15 18:43:08 +02:00
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
2021-03-24 23:41:40 +01:00
# 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 }
2021-03-24 23:41:40 +01:00
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
2021-03-24 23:41:40 +01:00
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
2021-03-24 23:41:40 +01:00
echo "Circuitbreaker Setting changed .."
2020-06-17 23:40:24 +02:00
anychange = 1
2021-03-24 23:41:40 +01:00
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh ${ choice }
2020-06-17 23:40:24 +02:00
else
2021-03-24 23:41:40 +01:00
echo "Circuitbreaker Setting unchanged."
2020-06-17 23:40:24 +02:00
fi
2021-09-14 22:36:54 +07:00
# 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
2020-07-04 15:45:41 +02:00
# LocalBackup process choice
2020-07-04 16:01:25 +02:00
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "e" )
2020-07-04 15:45:41 +02:00
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
2021-12-14 23:34:35 +01:00
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"
2021-09-12 22:36:57 +02:00
/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
2021-09-12 22:36:57 +02:00
/home/admin/config.scripts/lnd.install.sh on testnet initwallet
2021-08-30 20:19:57 +02:00
fi
2021-09-01 17:49:53 +01:00
if [ " ${ signet } " = = "on" ] ; then
2021-09-12 22:36:57 +02:00
/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 17:47:28 +01: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
2021-09-26 10:30:09 +01:00
# CL choice
2021-08-30 20:19:57 +02:00
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "n" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
2021-09-26 10:30:09 +01:00
if [ " ${ clNode } " != " ${ choice } " ] ; then
2021-08-30 20:39:13 +02:00
anychange = 1
2022-07-27 08:29:16 +02:00
echo "# Core Lightning NODE Setting changed .."
2021-08-30 20:19:57 +02:00
if [ " ${ choice } " = "on" ] ; then
echo "# turning ON"
2022-06-05 18:04:55 +02:00
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.install.sh on mainnet
2022-06-05 19:56:46 +02:00
# generate wallet from seedwords or just display (write to dev/null to not write seed words to logs)
/home/admin/config.scripts/cl.hsmtool.sh new mainnet 1>/dev/null
2021-08-30 20:19:57 +02:00
if [ " ${ testnet } " = = "on" ] ; then
2021-12-18 22:07:37 +00:00
# no seed for testnet
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.install.sh on testnet
2021-08-30 20:19:57 +02:00
fi
2021-09-01 17:49:53 +01:00
if [ " ${ signet } " = = "on" ] ; then
2021-12-18 22:07:37 +00:00
# no seed for signet
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.install.sh on signet
2021-08-30 20:19:57 +02:00
fi
2022-07-06 09:47:30 +01:00
# make sure that cln-grpc is on for the WebAPI
v1.9.0rc3 Merge (#3742)
* cln: use default normal feerate to withdraw all
* Bugfix: bad subsititution (#3668)
Fix for error:
/home/admin/config.scripts/bonus.go.sh: line 31: ${goOSversion{}: bad substitution
* whiptail one line
* fix syntax
* lnproxy: fix api access through nginx (#3671)
* lnproxy: fix api access through nginx
* fix tor config and fit the menu
* add to the menu and provision
* merge #3682
* cln update to v23.02, backup-plugin update, add poetry (#3684)
* cln backup-plugin update, add poetry
* fix mkdir error, remove commented code, fmt #3677
* poetry and path fixes
* add terminal feedback, format #3676
* detect the full name of the plugin
* install pyln-client tqdm with pip
* git-verify: add --keyid-format LONG
to recognise if the signing key is not the main key
* cln update to v23.02
* cln-grpc: add protobuf-compiler dep
* rtl update to v0.13.6 and formatting
* C-lightningREST update to v0.10.1
* CLN FAQ update (#3666)
* improve the detection of existing cln aliases
* add the emergencyrecover instructions to CLN FAQ
* update help entries
* Update Tallycoin to version 1.8.0 (#3693)
* add tallycoin update info to CHANGES
* Fix typo in README.md (#3699)
excepted -> accepted
* #3694 add LCD info
* #3664 att timeout 30s to ln monitor calls (#3665)
* fix setting LND_REST_ENDPOINT (#3689)
* btcpay update v1.8.2, postgres database fix (#3697)
* btcpay update v1.8.0, postgres database fix
* btcpayserver update to v1.8.2
* update lnbits to 0.10.2 and use poetry instead of venv (#3703)
* fix apt update Key error for influx repo (#3711)
Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>
* fix missing timeout value for nc cmnd (#3712)
Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>
* #3706 Update CLN v23.02.2 (#3716)
* used patched/rolledback 23.02.2 release
* check rusty sig
* fix typo
* fix default lightning setting
* #3683 Update LIT to 0.8.6 (#3717)
* update LIT to 0.8.6
* activate lnd rpcmiddleware
* CHANGES.md
* #3667 change all up/download from sftp tp scp (#3718)
* #3722 add no hostkeys available detection (#3723)
* #1186 FinTS/HBCI interface (#3704)
* #1186 FinTS install script first draft
* only start app when blitz is ready
* improve menu
* improve dit lnbits config
* preserve edit
* improve edit
* improve edit
* fix insertion
* dont use fingerprint
* now use main repo
* add port
* show local ip
* fix typo
* show port SSL
* Update bonus.lndg.sh (#3725)
* Update bonus.lndg.sh
Changes version to v1.6.0.
Fixes update menu bug.
Cleans up code a bit (removes tabs and changes to spaces to match raspiblitz formats).
* Update bonus.lndg.sh
Cleaned up code, added requirements.txt install to updates (needed for this update, may be needed in future).
* #3725 update lndg version in CHANGES
* #3692 update lnd to v0.16.0-beta (#3732)
* update SD CARD base image info
* Clenaup CHANGES info
* RTL install fix (#3739)
* c-lightning-REST update to 0.10.2, fmt
* rtl: npm insatll with --legacy-peer-deps
* purge c-lightning-REST as well with RTL
* jam update to v0.1.5 (#3736)
* 3733 CLN GRPC > JRPC (#3741)
* change exit code
* change to cln_jrpc
* deactivate the cln_grpc settings
* set v1.9.0rc3 version
---------
Co-authored-by: openoms <oms@tuta.io>
Co-authored-by: Metallicc <72348+metallicc@users.noreply.github.com>
Co-authored-by: openoms <43343391+openoms@users.noreply.github.com>
Co-authored-by: DJ Booth <djbooth007@gmail.com>
Co-authored-by: Yuck Fou <115867254+YuckFouBTC@users.noreply.github.com>
Co-authored-by: dni âš¡ <office@dnilabs.com>
Co-authored-by: PatrickScheich <50054697+PatrickScheich@users.noreply.github.com>
Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>
Co-authored-by: allyourbankarebelongtous <100060902+allyourbankarebelongtous@users.noreply.github.com>
2023-04-08 23:10:01 +02:00
echo "# install the cln-grpc plugin"
2022-07-06 09:47:30 +01:00
/home/admin/config.scripts/cl-plugin.cln-grpc.sh install
/home/admin/config.scripts/cl-plugin.cln-grpc.sh on
2021-08-30 20:19:57 +02:00
else
echo "# turning OFF"
2022-06-05 18:04:55 +02:00
/home/admin/config.scripts/cl-plugin.cln-grpc.sh off
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.install.sh off mainnet
/home/admin/config.scripts/cl.install.sh off testnet
/home/admin/config.scripts/cl.install.sh off signet
2021-08-30 20:19:57 +02:00
fi
else
2022-07-27 08:29:16 +02:00
echo "Core Lightning NODE setting unchanged."
2021-08-30 20:19:57 +02:00
fi
2021-09-20 12:06:57 +01:00
# CLBOSS process choice
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "o" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
2021-09-26 10:30:09 +01:00
if [ " ${ clboss } " != " ${ choice } " ] && [ " ${ clNode } " = = "on" ] ; then
2021-09-20 12:06:57 +01:00
echo "CLBOSS Setting changed .."
anychange = 1
2022-07-07 09:52:33 +01:00
if [ ${ choice } = on ] ; then
if /home/admin/config.scripts/cl-plugin.clboss.sh info; then
sudo /home/admin/config.scripts/cl-plugin.clboss.sh on
else
echo "CLBOSS install was cancelled."
sleep 2
fi
else
sudo /home/admin/config.scripts/cl-plugin.clboss.sh off
fi
2021-09-20 12:06:57 +01:00
needsReboot = 0
else
echo "CLBOSS Setting unchanged."
fi
2021-09-26 10:30:09 +01:00
# clEncryptedHSM process choice
2021-09-20 14:45:59 +01:00
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "h" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
2021-09-26 10:30:09 +01:00
if [ " ${ clEncryptedHSM } " != " ${ choice } " ] && [ " ${ clNode } " = = "on" ] ; then
echo "clEncryptedHSM Setting changed .."
2021-09-20 14:45:59 +01:00
anychange = 1
if [ " ${ choice } " = = "on" ] ; then
2022-02-09 09:53:13 +00:00
sudo /home/admin/config.scripts/cl.hsmtool.sh encrypt mainnet
2021-09-20 14:45:59 +01:00
else
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.hsmtool.sh decrypt mainnet
2021-09-20 14:45:59 +01:00
fi
needsReboot = 0
else
2021-09-26 10:30:09 +01:00
echo "clEncryptedHSM Setting unchanged."
2021-09-20 14:45:59 +01:00
fi
2021-09-26 10:30:09 +01:00
# clAutoUnlock process choice
2021-09-20 14:45:59 +01:00
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "q" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
2021-09-26 10:30:09 +01:00
if [ " ${ clAutoUnlock } " != " ${ choice } " ] && [ " ${ clNode } " = = "on" ] ; then
echo "clAutoUnlock Setting changed .."
2021-09-20 14:45:59 +01:00
anychange = 1
if [ " ${ choice } " = = "on" ] ; then
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.hsmtool.sh autounlock-on mainnet
2021-09-20 14:45:59 +01:00
else
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.hsmtool.sh autounlock-off mainnet
2021-09-20 14:45:59 +01:00
fi
needsReboot = 0
else
2021-09-26 10:30:09 +01:00
echo "clAutoUnlock Setting unchanged."
2021-09-20 14:45:59 +01:00
fi
2022-12-08 12:56:30 +01:00
# clWatchtowerClient process choice
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "w" )
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
if [ " ${ clWatchtowerClient } " != " ${ choice } " ] && [ " ${ clNode } " = = "on" ] ; then
echo "CL WATCHTOWER CLIENT Setting changed .."
anychange = 1
if [ ${ choice } = on ] ; then
if /home/admin/config.scripts/cl-plugin.watchtower-client.sh info; then
sudo /home/admin/config.scripts/cl-plugin.watchtower-client.sh on
else
echo "CL WATCHTOWER CLIENT install was cancelled."
sleep 2
fi
else
sudo /home/admin/config.scripts/cl-plugin.watchtower-client.sh off
fi
needsReboot = 0
else
echo "CL WATCHTOWER CLIENT Setting unchanged."
fi
2021-08-30 20:19:57 +02:00
# parallel testnet process choice
choice = "off" ; check = $( echo " ${ CHOICES } " | grep -c "p" )
2021-08-03 17:17:07 +02:00
if [ ${ check } -eq 1 ] ; then choice = "on" ; fi
2021-11-30 15:32:51 +00:00
if [ " ${ testnet } " != " ${ choice } " ] || \
[ " ${ signet } " != " ${ choice } " ] ; then
2021-08-30 20:19:57 +02:00
echo "# Parallel Testnets Setting changed .."
2021-08-03 17:17:07 +02:00
anychange = 1
2021-08-30 20:19:57 +02:00
if [ " ${ choice } " = "on" ] ; then
2021-09-01 17:43:38 +01:00
/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
2021-09-12 22:36:57 +02:00
/home/admin/config.scripts/lnd.install.sh on testnet initwallet
/home/admin/config.scripts/lnd.install.sh on signet initwallet
2021-08-03 17:17:07 +02:00
fi
2021-09-26 10:30:09 +01:00
if [ " ${ lightning } " = = "cl" ] || [ " ${ cl } " = = "on" ] ; then
/home/admin/config.scripts/cl.install.sh on testnet
/home/admin/config.scripts/cl.install.sh on signet
2021-12-14 23:34:35 +01:00
fi
2021-08-30 20:19:57 +02:00
else
2021-12-14 23:34:35 +01:00
# just turn all lightning testnets off (even if not on before)
2021-09-01 17:47:28 +01:00
/home/admin/config.scripts/lnd.install.sh off testnet
/home/admin/config.scripts/lnd.install.sh off signet
2021-09-26 10:30:09 +01:00
/home/admin/config.scripts/cl.install.sh off testnet
/home/admin/config.scripts/cl.install.sh off signet
2021-09-01 17:43:38 +01:00
/home/admin/config.scripts/bitcoin.install.sh off testnet
/home/admin/config.scripts/bitcoin.install.sh off signet
2021-08-03 17:17:07 +02:00
fi
2021-08-30 20:19:57 +02:00
# make sure to reboot - nodes that people activate testnets can take a reboot
needsReboot = 1
2021-08-03 17:17:07 +02:00
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
2021-06-24 19:30:33 +02:00
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
2020-06-17 23:40:24 +02:00
fi