mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-25 19:21:57 +02:00
improve webapi config during setup
This commit is contained in:
@@ -131,10 +131,20 @@ if [ "$1" = "update-config" ]; then
|
||||
chain="main"
|
||||
fi
|
||||
|
||||
# get actual state of system
|
||||
source <(/home/admin/_cache.sh get setupPhase)
|
||||
|
||||
# prepare config update
|
||||
cd /root/blitz_api
|
||||
cp ./.env_sample ./.env
|
||||
dateStr=$(date)
|
||||
echo "# Update Web API CONFIG (${dateStr})"
|
||||
sed -i "s/^# platform=.*/platform=raspiblitz/g" ./.env
|
||||
sed -i "s/^platform=.*/platform=raspiblitz/g" ./.env
|
||||
|
||||
if [ "${setupPhase}" == "done" ]; then
|
||||
|
||||
# configure bitcoin
|
||||
RPCUSER=$(sudo cat /mnt/hdd/${network}/${network}.conf 2>/dev/null | grep rpcuser | cut -c 9-)
|
||||
RPCPASS=$(sudo cat /mnt/hdd/${network}/${network}.conf 2>/dev/null | grep rpcpassword | cut -c 13-)
|
||||
if [ "${RPCUSER}" == "" ]; then
|
||||
@@ -148,8 +158,7 @@ if [ "$1" = "update-config" ]; then
|
||||
sed -i "s/^bitcoind_ip_testnet=.*/bitcoind_ip_testnet=127.0.0.1/g" ./.env
|
||||
sed -i "s/^bitcoind_user=.*/bitcoind_user=${RPCUSER}/g" ./.env
|
||||
sed -i "s/^bitcoind_pw=.*/bitcoind_pw=${RPCPASS}/g" ./.env
|
||||
sed -i "s/^# platform=.*/platform=raspiblitz/g" ./.env
|
||||
sed -i "s/^platform=.*/platform=raspiblitz/g" ./.env
|
||||
|
||||
|
||||
# configure LND
|
||||
if [ "${lightning}" == "lnd" ]; then
|
||||
@@ -200,6 +209,10 @@ if [ "$1" = "update-config" ]; then
|
||||
sed -i "s/^ln_node=.*/ln_node=/g" ./.env
|
||||
fi
|
||||
|
||||
else
|
||||
echo "# CONFIG Web API ... still in setup, skip bitcoin & lightning"
|
||||
fi
|
||||
|
||||
echo "# '.env' config updates - blitzapi maybe needs to be restarted"
|
||||
exit 0
|
||||
|
||||
|
Reference in New Issue
Block a user