mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-21 14:11:06 +02:00
4876 lnbits (#4877)
* #4878 respect old LNBITS_ADMIN_UI setting * #4876 lnbits option to switch ADMINUI * #4876 add no new accounts option * #4876 remove accounts option again
This commit is contained in:
@@ -226,6 +226,14 @@ Consider adding a IP2TOR Bridge under OPTIONS."
|
|||||||
OPTIONS+=(MIGRATE-DB "Migrate SQLite to PostgreSQL database")
|
OPTIONS+=(MIGRATE-DB "Migrate SQLite to PostgreSQL database")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Admin UI
|
||||||
|
activatedAdminUI=$(sudo grep -c "LNBITS_ADMIN_UI=true" $lnbitsConfig)
|
||||||
|
if [ ${activatedAdminUI} -eq 0 ]; then
|
||||||
|
OPTIONS+=(ADMINUI "Activate 'Admin UI'")
|
||||||
|
else
|
||||||
|
OPTIONS+=(ADMINUI "Deactivate 'Admin UI'")
|
||||||
|
fi
|
||||||
|
|
||||||
WIDTH=66
|
WIDTH=66
|
||||||
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
||||||
HEIGHT=$((CHOICE_HEIGHT + 7))
|
HEIGHT=$((CHOICE_HEIGHT + 7))
|
||||||
@@ -286,6 +294,24 @@ Consider adding a IP2TOR Bridge under OPTIONS."
|
|||||||
read key
|
read key
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
ADMINUI)
|
||||||
|
clear
|
||||||
|
echo
|
||||||
|
if [ ${activatedAdminUI} -eq 0 ]; then
|
||||||
|
echo "Activate Admin UI"
|
||||||
|
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
||||||
|
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
||||||
|
else
|
||||||
|
echo "Deactivate Admin UI"
|
||||||
|
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
||||||
|
sudo bash -c "echo 'LNBITS_ADMIN_UI=false' >> ${lnbitsConfig}"
|
||||||
|
fi
|
||||||
|
echo "Restarting LNbits ..."
|
||||||
|
sudo systemctl restart lnbits
|
||||||
|
echo "PRESS ENTER to continue"
|
||||||
|
read key
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
RESTORE)
|
RESTORE)
|
||||||
clear
|
clear
|
||||||
# check if backup exist
|
# check if backup exist
|
||||||
@@ -780,16 +806,17 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
echo "# preparing env file"
|
echo "# preparing env file"
|
||||||
# delete old .env file or old symbolic link
|
# delete old .env file or old symbolic link
|
||||||
sudo rm /home/lnbits/lnbits/.env 2>/dev/null
|
sudo rm /home/lnbits/lnbits/.env 2>/dev/null
|
||||||
|
|
||||||
# make sure .env file exists at data drive
|
# make sure .env file exists at data drive
|
||||||
sudo -u lnbits touch $lnbitsConfig
|
if [ ! -f $lnbitsConfig ]; then
|
||||||
|
sudo -u lnbits touch $lnbitsConfig
|
||||||
|
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
||||||
|
fi
|
||||||
sudo chown lnbits:lnbits $lnbitsConfig
|
sudo chown lnbits:lnbits $lnbitsConfig
|
||||||
|
|
||||||
# crete symbolic link
|
# crete symbolic link
|
||||||
sudo -u lnbits ln -s $lnbitsConfig /home/lnbits/lnbits/.env
|
sudo -u lnbits ln -s $lnbitsConfig /home/lnbits/lnbits/.env
|
||||||
|
|
||||||
# activate admin user
|
|
||||||
sudo sed -i "/^LNBITS_ADMIN_UI=/d" $lnbitsConfig
|
|
||||||
sudo bash -c "echo 'LNBITS_ADMIN_UI=true' >> ${lnbitsConfig}"
|
|
||||||
|
|
||||||
if [ ! -e /mnt/hdd/app-data/LNBits/database.sqlite3 ]; then
|
if [ ! -e /mnt/hdd/app-data/LNBits/database.sqlite3 ]; then
|
||||||
echo "# install database: PostgreSQL"
|
echo "# install database: PostgreSQL"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user