#729 adding option to the service menu

This commit is contained in:
rootzoll 2020-03-21 21:54:44 -07:00
parent 6a69d4a923
commit 2c145044d8

View file

@ -23,6 +23,9 @@ if [ ${#ElectRS} -eq 0 ]; then ElectRS="off"; fi
if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi
if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi
DropboxBackup="off";
if [ ${#dropboxBackupTarget} -gt 0 ]; then DropboxBackup="on"; fi
echo "map chain to on/off" echo "map chain to on/off"
chainValue="off" chainValue="off"
if [ "${chain}" = "test" ]; then chainValue="on"; fi if [ "${chain}" = "test" ]; then chainValue="on"; fi
@ -75,6 +78,7 @@ e 'Electrum Rust Server' ${ElectRS} \
p 'BTCPayServer' ${BTCPayServer} \ p 'BTCPayServer' ${BTCPayServer} \
m 'lndmanage' ${lndmanage} \ m 'lndmanage' ${lndmanage} \
i 'LNBits' ${LNBits} \ i 'LNBits' ${LNBits} \
d 'Static Channel Backup on DropBox' ${DropboxBackup} \
2>&1 >/dev/tty) 2>&1 >/dev/tty)
else else
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \ CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \
@ -95,6 +99,7 @@ e 'Electrum Rust Server' ${ElectRS} \
p 'BTCPayServer' ${BTCPayServer} \ p 'BTCPayServer' ${BTCPayServer} \
m 'lndmanage' ${lndmanage} \ m 'lndmanage' ${lndmanage} \
i 'LNBits' ${LNBits} \ i 'LNBits' ${LNBits} \
d 'Static Channel Backup on DropBox' ${DropboxBackup} \
2>&1 >/dev/tty) 2>&1 >/dev/tty)
fi fi
@ -539,6 +544,22 @@ else
echo "lndmanage setting unchanged." echo "lndmanage setting unchanged."
fi fi
# DropBox process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "d")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${DropboxBackup}" != "${choice}" ]; then
echo "DropBox Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/dropbox.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/dropbox.upload.sh upload ${dropboxBackupTarget} /home/admin/.lnd/data/chain/${network}/${chain}net/channel.backup
fi
else
echo "lndmanage setting unchanged."
fi
if [ ${anychange} -eq 0 ]; then if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58 dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0 exit 0