-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use .env.example from LNbits package as .env template
- Loading branch information
Showing
2 changed files
with
19 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
source /usr/share/mynode/mynode_app_versions.sh | ||
|
||
# Copy config file | ||
if [ ! -f /mnt/hdd/mynode/lnbits/.env ]; then | ||
cp /usr/share/mynode/lnbits.env /mnt/hdd/mynode/lnbits/.env | ||
# Delete old myNode .env file created before 0.12.x | ||
if [ -f /usr/share/mynode/lnbits.env ]; then | ||
rm -f /usr/share/mynode/lnbits.env | ||
fi | ||
|
||
# if current LNbits version config is missign create .env from .env.example | ||
if [ ! -f /mnt/hdd/mynode/lnbits/update_config_$LNBITS_VERSION ]; then | ||
rm -f /mnt/hdd/mynode/lnbits/update_config_* | ||
touch /mnt/hdd/mynode/lnbits/update_config_$LNBITS_VERSION | ||
|
||
cp -f /opt/mynode/lnbits/.env.example /mnt/hdd/mynode/lnbits/.env | ||
chown bitcoin:bitcoin /mnt/hdd/mynode/lnbits/.env | ||
|
||
# Use ADMIN_UI | ||
sed -i "s|^LNBITS_ADMIN_UI=.*|LNBITS_ADMIN_UI=true|g" /mnt/hdd/mynode/lnbits/.env | ||
|
||
# Update env file with files mapped in lnbits.service | ||
sed -i "s|^LND_REST_CERT=.*|LND_REST_CERT=\"/app/tls.cert\"|g" /mnt/hdd/mynode/lnbits/.env | ||
sed -i "s|^LND_REST_MACAROON=.*|LND_REST_MACAROON=\"/app/admin.macaroon\"|g" /mnt/hdd/mynode/lnbits/.env | ||
fi | ||
|
||
# Force update of LNBits config file (increment to force new update) | ||
# LNBITS_CONFIG_UPDATE_NUM=1 | ||
# if [ ! -f /mnt/hdd/mynode/lnbits/update_config_$LNBITS_CONFIG_UPDATE_NUM ]; then | ||
# cp -f /usr/share/mynode/lnbits.env /mnt/hdd/mynode/lnbits/.env | ||
# chown bitcoin:bitcoin /mnt/hdd/mynode/lnbits/.env | ||
# touch /mnt/hdd/mynode/lnbits/update_config_$LNBITS_CONFIG_UPDATE_NUM | ||
# fi | ||
|
||
# Generate hex macaroons | ||
#macaroonAdminHex=$(xxd -ps -u -c 1000 /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon) | ||
|
||
# Update env file | ||
sed -i "s|^LND_REST_MACAROON=.*|LND_REST_MACAROON=\"/app/admin.macaroon\"|g" /mnt/hdd/mynode/lnbits/.env |
This file was deleted.
Oops, something went wrong.