Fix more configure bugs

This commit is contained in:
Aaron Dewes 2023-08-29 10:44:15 +00:00
parent c1e92d40f6
commit 663d294d02

28
scripts/configure vendored
View File

@ -333,29 +333,11 @@ if reconfiguring:
implementation = "lnd"
# Get APP_<IMPLEMENTATION>_MIDDLEWARE_IP from the .env file
dotenv=parse_dotenv('./.env')
MIDDLEWARE_IP = dotenv["APP_{}_MIDDLEWARE_IP".format(implementation.upper().replace("-", "_"))]
build_template("./templates/.env-sample", "./.env")
print("Updating app configuration...\n")
os.system('./scripts/app generate')
# TODO: Remove this, this is just the above again to ensure LND works properly
# Run ./scripts/app get-implementation lightning to get the implementation
# If it fails, install the LND app and set the implementation to LND
try:
implementation = subprocess.check_output("./scripts/app get-implementation lightning", shell=True).decode("utf-8").strip()
except:
print("Installing LND...\n")
os.system('./scripts/app install lnd')
implementation = "lnd"
# Get APP_<IMPLEMENTATION>_MIDDLEWARE_IP from the .env file
dotenv=parse_dotenv('./.env')
MIDDLEWARE_IP = dotenv["APP_{}_MIDDLEWARE_IP".format(implementation.upper().replace("-", "_"))]
if reconfiguring:
dotenv=parse_dotenv('./.env')
MIDDLEWARE_IP = dotenv["APP_{}_MIDDLEWARE_IP".format(implementation.upper().replace("-", "_"))]
else:
MIDDLEWARE_IP = "0.0.0.0"
build_template("./templates/.env-sample", "./.env")