#3191 move blitzapi option to SETTINGS menu

This commit is contained in:
rootzoll 2022-06-29 21:34:57 +02:00
parent 936457c5d1
commit a6a3346109
3 changed files with 34 additions and 21 deletions

View File

@ -17,6 +17,7 @@ if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
if [ ${#clEncryptedHSM} -eq 0 ]; then clEncryptedHSM="off"; fi
if [ ${#clAutoUnlock} -eq 0 ]; then clAutoUnlock="off"; fi
if [ ${#blitzapi} -eq 0 ]; then blitzapi="off"; fi
echo "# map LND to on/off"
lndNode="off"
@ -107,6 +108,8 @@ echo "run dialog ..."
# BASIC MENU INFO
OPTIONS=()
OPTIONS+=(A 'Blitz API + WebUI' ${blitzapi})
# LCD options (only when running with LCD screen)
if [ "${displayClass}" == "lcd" ]; then
OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu})
@ -163,6 +166,25 @@ fi
needsReboot=0
anychange=0
# 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
sudo /home/admin/config.scripts/blitz.web.api.sh ${choice}
sudo /home/admin/config.scripts/blitz.web.ui.sh ${choice}
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
# LND AUTOPILOT process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
if [ ${check} -eq 1 ]; then choice="on"; fi

View File

@ -32,7 +32,6 @@ if [ ${#helipad} -eq 0 ]; then helipad="off"; fi
if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi
if [ ${#squeaknode} -eq 0 ]; then squeaknode="off"; fi
if [ ${#itchysats} -eq 0 ]; then itchysats="off"; fi
if [ ${#blitzapi} -eq 0 ]; then blitzapi="off"; fi
# show select dialog
echo "run dialog ..."
@ -79,7 +78,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
fi
OPTIONS+=(m 'Homer Dashboard' ${homer})
OPTIONS+=(A 'Blitz API + webUI' ${blitzapi})
CHOICES=$(dialog --title ' Additional Mainnet Services ' \
--checklist ' use spacebar to activate/de-activate ' \
@ -545,25 +543,6 @@ else
echo "Homer Setting unchanged."
fi
# 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
sudo /home/admin/config.scripts/blitz.web.api.sh ${choice}
sudo /home/admin/config.scripts/blitz.web.ui.sh ${choice}
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
# BitcoinMinds process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "v")
if [ ${check} -eq 1 ]; then choice="on"; fi

View File

@ -889,6 +889,18 @@ fi
echo "load configfile data" >> $logFile
source ${configFile}
# write webapi state if not part of config yet
if [ "${blitzapi}" == "" ]; then
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
echo "Init config value blitzapi (${blitzApiInstalled})" >> $logFile
if [ $blitzApiInstalled -eq 0 ]; then
/home/admin/config.scripts/blitz.conf.sh set blitzapi "off"
else
/home/admin/config.scripts/blitz.conf.sh set blitzapi "on"
fi
source ${configFile}
fi
# if a WIFI config exists backup to HDD
source <(/home/admin/config.scripts/internet.sh status)
if [ ${configWifiExists} -eq 1 ]; then