mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 12:23:11 +02:00
#3191 move blitzapi option to SETTINGS menu
This commit is contained in:
@@ -17,6 +17,7 @@ if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
|
|||||||
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
|
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
|
||||||
if [ ${#clEncryptedHSM} -eq 0 ]; then clEncryptedHSM="off"; fi
|
if [ ${#clEncryptedHSM} -eq 0 ]; then clEncryptedHSM="off"; fi
|
||||||
if [ ${#clAutoUnlock} -eq 0 ]; then clAutoUnlock="off"; fi
|
if [ ${#clAutoUnlock} -eq 0 ]; then clAutoUnlock="off"; fi
|
||||||
|
if [ ${#blitzapi} -eq 0 ]; then blitzapi="off"; fi
|
||||||
|
|
||||||
echo "# map LND to on/off"
|
echo "# map LND to on/off"
|
||||||
lndNode="off"
|
lndNode="off"
|
||||||
@@ -107,6 +108,8 @@ echo "run dialog ..."
|
|||||||
# BASIC MENU INFO
|
# BASIC MENU INFO
|
||||||
OPTIONS=()
|
OPTIONS=()
|
||||||
|
|
||||||
|
OPTIONS+=(A 'Blitz API + WebUI' ${blitzapi})
|
||||||
|
|
||||||
# LCD options (only when running with LCD screen)
|
# LCD options (only when running with LCD screen)
|
||||||
if [ "${displayClass}" == "lcd" ]; then
|
if [ "${displayClass}" == "lcd" ]; then
|
||||||
OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu})
|
OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu})
|
||||||
@@ -163,6 +166,25 @@ fi
|
|||||||
needsReboot=0
|
needsReboot=0
|
||||||
anychange=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
|
# LND AUTOPILOT process choice
|
||||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
|
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
|
||||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||||
|
@@ -32,7 +32,6 @@ if [ ${#helipad} -eq 0 ]; then helipad="off"; fi
|
|||||||
if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi
|
if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi
|
||||||
if [ ${#squeaknode} -eq 0 ]; then squeaknode="off"; fi
|
if [ ${#squeaknode} -eq 0 ]; then squeaknode="off"; fi
|
||||||
if [ ${#itchysats} -eq 0 ]; then itchysats="off"; fi
|
if [ ${#itchysats} -eq 0 ]; then itchysats="off"; fi
|
||||||
if [ ${#blitzapi} -eq 0 ]; then blitzapi="off"; fi
|
|
||||||
|
|
||||||
# show select dialog
|
# show select dialog
|
||||||
echo "run dialog ..."
|
echo "run dialog ..."
|
||||||
@@ -79,7 +78,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
OPTIONS+=(m 'Homer Dashboard' ${homer})
|
OPTIONS+=(m 'Homer Dashboard' ${homer})
|
||||||
OPTIONS+=(A 'Blitz API + webUI' ${blitzapi})
|
|
||||||
|
|
||||||
CHOICES=$(dialog --title ' Additional Mainnet Services ' \
|
CHOICES=$(dialog --title ' Additional Mainnet Services ' \
|
||||||
--checklist ' use spacebar to activate/de-activate ' \
|
--checklist ' use spacebar to activate/de-activate ' \
|
||||||
@@ -545,25 +543,6 @@ else
|
|||||||
echo "Homer Setting unchanged."
|
echo "Homer Setting unchanged."
|
||||||
fi
|
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
|
# BitcoinMinds process choice
|
||||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "v")
|
choice="off"; check=$(echo "${CHOICES}" | grep -c "v")
|
||||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||||
|
@@ -889,6 +889,18 @@ fi
|
|||||||
echo "load configfile data" >> $logFile
|
echo "load configfile data" >> $logFile
|
||||||
source ${configFile}
|
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
|
# if a WIFI config exists backup to HDD
|
||||||
source <(/home/admin/config.scripts/internet.sh status)
|
source <(/home/admin/config.scripts/internet.sh status)
|
||||||
if [ ${configWifiExists} -eq 1 ]; then
|
if [ ${configWifiExists} -eq 1 ]; then
|
||||||
|
Reference in New Issue
Block a user